Merge "HWUI: do not call glCopyTexSubImage2D on empty area." into nyc-dev am: e4e240f13f
am: e136aba4ad
* commit 'e136aba4adcef06eea4d237eb18b031704c37f59':
HWUI: do not call glCopyTexSubImage2D on empty area.
Change-Id: I7a79fdcf6058dc8867c94ef2d66b6f7b5c3ab1ea
This commit is contained in:
@@ -96,15 +96,15 @@ void BakedOpRenderer::endLayer() {
|
||||
}
|
||||
|
||||
OffscreenBuffer* BakedOpRenderer::copyToLayer(const Rect& area) {
|
||||
OffscreenBuffer* buffer = mRenderState.layerPool().get(mRenderState,
|
||||
area.getWidth(), area.getHeight());
|
||||
if (!area.isEmpty()) {
|
||||
const uint32_t width = area.getWidth();
|
||||
const uint32_t height = area.getHeight();
|
||||
OffscreenBuffer* buffer = mRenderState.layerPool().get(mRenderState, width, height);
|
||||
if (!area.isEmpty() && width != 0 && height != 0) {
|
||||
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());
|
||||
area.left, mRenderTarget.viewportHeight - area.bottom, width, height);
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user