Unclipped savelayer support in new renderer
bug:22480459
Change-Id: I89dd5de8d7d008a1e298d227d767aabff5c96e27
diff --git a/libs/hwui/BakedOpRenderer.cpp b/libs/hwui/BakedOpRenderer.cpp
index 4aebe3c..b9c13e6 100644
--- a/libs/hwui/BakedOpRenderer.cpp
+++ b/libs/hwui/BakedOpRenderer.cpp
@@ -79,6 +79,20 @@
mRenderTarget.frameBufferId = 0;
}
+OffscreenBuffer* BakedOpRenderer::copyToLayer(const Rect& area) {
+ OffscreenBuffer* buffer = mRenderState.layerPool().get(mRenderState,
+ area.getWidth(), area.getHeight());
+ if (!area.isEmpty()) {
+ mCaches.textureState().activateTexture(0);
+ mCaches.textureState().bindTexture(buffer->texture.id);
+
+ glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0,
+ area.left, mRenderTarget.viewportHeight - area.bottom,
+ area.getWidth(), area.getHeight());
+ }
+ return buffer;
+}
+
void BakedOpRenderer::startFrame(uint32_t width, uint32_t height, const Rect& repaintRect) {
LOG_ALWAYS_FATAL_IF(mRenderTarget.frameBufferId != 0, "primary framebufferId must be 0");
mRenderState.bindFramebuffer(0);