Fix accidental activateTexture(0)
Bug: 26584230
activateTexture(0) was accidentally refactored into
Texture::upload. Only OffscreenBuffer intended for the
texture unit to change
Change-Id: I5dbfc3eab8843733084ce1ce38a0a946abf0e05b
diff --git a/libs/hwui/Texture.cpp b/libs/hwui/Texture.cpp
index 92de894..0f02f4c 100644
--- a/libs/hwui/Texture.cpp
+++ b/libs/hwui/Texture.cpp
@@ -95,7 +95,6 @@
void Texture::upload(GLint internalformat, uint32_t width, uint32_t height,
GLenum format, GLenum type, const void* pixels) {
GL_CHECKPOINT();
- mCaches.textureState().activateTexture(0);
bool needsAlloc = updateSize(width, height, internalformat);
if (!mId) {
glGenTextures(1, &mId);
diff --git a/libs/hwui/renderstate/OffscreenBufferPool.cpp b/libs/hwui/renderstate/OffscreenBufferPool.cpp
index 98c94df..54f38e8 100644
--- a/libs/hwui/renderstate/OffscreenBufferPool.cpp
+++ b/libs/hwui/renderstate/OffscreenBufferPool.cpp
@@ -41,6 +41,7 @@
, texture(caches) {
uint32_t width = computeIdealDimension(viewportWidth);
uint32_t height = computeIdealDimension(viewportHeight);
+ caches.textureState().activateTexture(0);
texture.resize(width, height, GL_RGBA);
texture.blend = true;
texture.setWrap(GL_CLAMP_TO_EDGE);