From 68eccdade2aad22b7eb34a28572c204dcd54f7b9 Mon Sep 17 00:00:00 2001 From: Riley Andrews Date: Mon, 7 Jul 2014 11:47:35 -0700 Subject: [PATCH] Add cursor flags into SpriteController to suppor async cursor updates. - This is fairly blindly taken from nvidia's implementation. Change-Id: I825ecbd9cb4b394793dce079591b37efca546bbe --- core/java/android/view/SurfaceControl.java | 5 +++++ libs/input/SpriteController.cpp | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index bd46d07838371..191ad64cc8e89 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -156,6 +156,11 @@ public class SurfaceControl { // 0x1000 is reserved for an independent DRM protected flag in framework + /** + * Surface creation flag: Window represents a cursor glyph. + */ + public static final int CURSOR_WINDOW = 0x00002000; + /** * Surface creation flag: Creates a normal surface. * This is the default. diff --git a/libs/input/SpriteController.cpp b/libs/input/SpriteController.cpp index a69c32d7ff044..5391393391974 100644 --- a/libs/input/SpriteController.cpp +++ b/libs/input/SpriteController.cpp @@ -370,7 +370,8 @@ sp SpriteController::obtainSurface(int32_t width, int32_t height sp surfaceControl = mSurfaceComposerClient->createSurface( String8("Sprite"), width, height, PIXEL_FORMAT_RGBA_8888, - ISurfaceComposerClient::eHidden); + ISurfaceComposerClient::eHidden | + ISurfaceComposerClient::eCursorWindow); if (surfaceControl == NULL || !surfaceControl->isValid()) { ALOGE("Error creating sprite surface."); return NULL;