diff options
author | Riley Andrews <riandrews@google.com> | 2014-07-01 14:22:59 -0700 |
---|---|---|
committer | Riley Andrews <riandrews@google.com> | 2014-07-28 22:07:41 +0000 |
commit | 03414a1cfe6c1222fd7723949bd622f9cba145aa (patch) | |
tree | c4b15dbf1bb03636c6e9612082b2b3f23ba495b1 /services/surfaceflinger/DisplayHardware/HWComposer.cpp | |
parent | d8e5e813433c5c5e4fea29a24d993b5cfe436fe0 (diff) | |
download | frameworks_native-03414a1cfe6c1222fd7723949bd622f9cba145aa.zip frameworks_native-03414a1cfe6c1222fd7723949bd622f9cba145aa.tar.gz frameworks_native-03414a1cfe6c1222fd7723949bd622f9cba145aa.tar.bz2 |
Turn on support for async cursor update in surfaceflinger.
If available, surfaceflinger will use the hwc setCursorPositionAsync()
api to change the position of supported cursor layers outside of
the usual prepare/set loop.
Change-Id: Ib3fc5c0c390b3489ddbba202379840a1d2748917
Diffstat (limited to 'services/surfaceflinger/DisplayHardware/HWComposer.cpp')
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWComposer.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index 185dab2..a8fb5bd 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -681,6 +681,9 @@ status_t HWComposer::prepare() { if (l.compositionType == HWC_OVERLAY) { disp.hasOvComp = true; } + if (l.compositionType == HWC_CURSOR_OVERLAY) { + disp.hasOvComp = true; + } } if (disp.list->numHwLayers == (disp.framebufferTarget ? 1 : 0)) { disp.hasFbComp = true; @@ -853,6 +856,16 @@ sp<Fence> HWComposer::getLastRetireFence(int32_t id) const { return mDisplayData[id].lastRetireFence; } +status_t HWComposer::setCursorPositionAsync(int32_t id, const Rect& pos) +{ + if (mHwc->setCursorPositionAsync) { + return (status_t)mHwc->setCursorPositionAsync(mHwc, id, pos.left, pos.top); + } + else { + return NO_ERROR; + } +} + /* * Helper template to implement a concrete HWCLayer * This holds the pointer to the concrete hwc layer type @@ -935,6 +948,16 @@ public: getLayer()->flags &= ~HWC_SKIP_LAYER; } } + virtual void setIsCursorLayerHint(bool isCursor) { + if (hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_4)) { + if (isCursor) { + getLayer()->flags |= HWC_IS_CURSOR_LAYER; + } + else { + getLayer()->flags &= ~HWC_IS_CURSOR_LAYER; + } + } + } virtual void setBlending(uint32_t blending) { getLayer()->blending = blending; } @@ -1122,6 +1145,8 @@ void HWComposer::dump(String8& result) const { "HWC", "BKGND", "FB TARGET", + "SIDEBAND", + "HWC_CURSOR", "UNKNOWN"}; if (type >= NELEM(compositionTypeName)) type = NELEM(compositionTypeName) - 1; |