diff options
author | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2016-03-18 10:36:07 +0100 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2016-03-18 10:36:07 +0100 |
commit | 813d4309fb2144b96ffcd644c71a30aadc50fd1e (patch) | |
tree | 532609cc34968f682701176114c484f5278b8349 /libs/hwui | |
parent | 8bc386657e4bd582ea0897410523e27230a8e157 (diff) | |
parent | df301d4a64fe0dfc812b39e3f7e2c2ca4b93c305 (diff) | |
download | frameworks_base-05a982aafebd19fe2d23c65cd6cf3f7e2f11ea27.zip frameworks_base-05a982aafebd19fe2d23c65cd6cf3f7e2f11ea27.tar.gz frameworks_base-05a982aafebd19fe2d23c65cd6cf3f7e2f11ea27.tar.bz2 |
Merge branch 'cm-13.0' of https://github.com/CyanogenMod/android_frameworks_base into replicant-6.0replicant-6.0-alpha-0004
Diffstat (limited to 'libs/hwui')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 2 | ||||
-rw-r--r-- | libs/hwui/font/CacheTexture.cpp | 14 | ||||
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.cpp | 4 |
3 files changed, 13 insertions, 7 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 773c6f5..88a6979 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -181,7 +181,7 @@ void OpenGLRenderer::discardFramebuffer(float left, float top, float right, floa } void OpenGLRenderer::clear(float left, float top, float right, float bottom, bool opaque) { -#ifdef QCOM_BSP_LEGACY +#ifdef QCOM_HARDWARE mRenderState.scissor().setEnabled(true); mRenderState.scissor().set(left, getViewportHeight() - bottom, right - left, bottom - top); glClear(GL_COLOR_BUFFER_BIT); diff --git a/libs/hwui/font/CacheTexture.cpp b/libs/hwui/font/CacheTexture.cpp index d2685da..a767a4e 100644 --- a/libs/hwui/font/CacheTexture.cpp +++ b/libs/hwui/font/CacheTexture.cpp @@ -204,15 +204,21 @@ void CacheTexture::allocatePixelBuffer() { bool CacheTexture::upload() { const Rect& dirtyRect = mDirtyRect; - uint32_t x = mHasUnpackRowLength ? dirtyRect.left : 0; - uint32_t y = dirtyRect.top; - uint32_t width = mHasUnpackRowLength ? dirtyRect.getWidth() : getWidth(); - uint32_t height = dirtyRect.getHeight(); + // align the x direction to 32 and y direction to 4 for better performance + uint32_t x = (((uint32_t)dirtyRect.left) & (~0x1F)); + uint32_t y = (((uint32_t)dirtyRect.top) & (~0x3)); + uint32_t r = ((((uint32_t)dirtyRect.right) + 0x1F) & (~0x1F)); + uint32_t b = ((((uint32_t)dirtyRect.bottom) + 0x3) & (~0x3)); + uint32_t width = (r > getWidth() ? getWidth() : r) - x; + uint32_t height = (b > getHeight() ? getHeight() : b) - y; // The unpack row length only needs to be specified when a new // texture is bound if (mHasUnpackRowLength) { glPixelStorei(GL_UNPACK_ROW_LENGTH, getWidth()); + } else { + x = 0; + width = getWidth(); } mPixelBuffer->upload(x, y, width, height); diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index 87a703c..57e5832 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -288,11 +288,11 @@ void CanvasContext::doFrame() { ATRACE_CALL(); + nsecs_t vsync = mRenderThread.timeLord().computeFrameTimeNanos(); int64_t frameInfo[UI_THREAD_FRAME_INFO_SIZE]; UiFrameInfoBuilder(frameInfo) .addFlag(FrameInfoFlags::RTAnimation) - .setVsync(mRenderThread.timeLord().computeFrameTimeNanos(), - mRenderThread.timeLord().latestVsync()); + .setVsync(vsync, vsync); TreeInfo info(TreeInfo::MODE_RT_ONLY, mRenderThread.renderState()); prepareTree(info, frameInfo, systemTime(CLOCK_MONOTONIC)); |