diff options
| author | 2017-02-14 12:37:49 -0800 | |
|---|---|---|
| committer | 2017-02-15 17:22:22 +0000 | |
| commit | 09df887c9078a34f2bda32c83734b7f75c0a60ff (patch) | |
| tree | 721240c45b25a85008be24301cbb81fd96721b0e /libs/hwui/GlLayer.cpp | |
| parent | 4211358c7448147388c5e4af3e0e5472def83a3b (diff) | |
Always flush renderstate in DeferredLayerUpdater::apply
Bug: 34206215
Test: hwui unit tests passing, manual test of TextureView video playback
Always flush renderstate to the GlLayer's texture, regardless of
whether updateTexImage has ever been called.
Change-Id: I3974dce9d90633a0299e6bc4259b76c622717c90
Diffstat (limited to 'libs/hwui/GlLayer.cpp')
| -rw-r--r-- | libs/hwui/GlLayer.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libs/hwui/GlLayer.cpp b/libs/hwui/GlLayer.cpp index aacad548c68b..070e95432a11 100644 --- a/libs/hwui/GlLayer.cpp +++ b/libs/hwui/GlLayer.cpp @@ -55,9 +55,15 @@ void GlLayer::onGlContextLost() { texture.deleteTexture(); } -void GlLayer::bindTexture() const { - if (texture.mId) { - caches.textureState().bindTexture(texture.target(), texture.mId); +void GlLayer::setRenderTarget(GLenum renderTarget) { + if (renderTarget != getRenderTarget()) { + // new render target: bind with new target, and update filter/wrap + texture.mTarget = renderTarget; + if (texture.mId) { + caches.textureState().bindTexture(texture.target(), texture.mId); + } + texture.setFilter(GL_NEAREST, false, true); + texture.setWrap(GL_CLAMP_TO_EDGE, false, true); } } |