diff options
| author | 2011-12-13 17:29:42 -0800 | |
|---|---|---|
| committer | 2011-12-13 17:29:42 -0800 | |
| commit | 8a5f8ba4f3e8352155c711adb649e6f536d194b5 (patch) | |
| tree | 2f6e85f60a439fc9569f64d0208d002a91ac7d65 /libs/hwui/SkiaShader.cpp | |
| parent | b5052de75736527549d7e537632777c6fec2e4f0 (diff) | |
| parent | a1d3c91afbd52c7e8b01f4a9060c5459f02ae7a5 (diff) | |
Merge "Further reduce the number of GL commands sent to the driver"
Diffstat (limited to 'libs/hwui/SkiaShader.cpp')
| -rw-r--r-- | libs/hwui/SkiaShader.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/libs/hwui/SkiaShader.cpp b/libs/hwui/SkiaShader.cpp index 32e75330599b..66993a48e088 100644 --- a/libs/hwui/SkiaShader.cpp +++ b/libs/hwui/SkiaShader.cpp @@ -20,6 +20,7 @@ #include <SkMatrix.h> +#include "Caches.h" #include "SkiaShader.h" #include "Texture.h" #include "Matrix.h" @@ -31,12 +32,6 @@ namespace uirenderer { // Support /////////////////////////////////////////////////////////////////////////////// -static const GLenum gTextureUnitsMap[] = { - GL_TEXTURE0, - GL_TEXTURE1, - GL_TEXTURE2 -}; - static const GLint gTileModes[] = { GL_CLAMP_TO_EDGE, // == SkShader::kClamp_TileMode GL_REPEAT, // == SkShader::kRepeat_Mode @@ -129,7 +124,7 @@ void SkiaBitmapShader::describe(ProgramDescription& description, const Extension void SkiaBitmapShader::setupProgram(Program* program, const mat4& modelView, const Snapshot& snapshot, GLuint* textureUnit) { GLuint textureSlot = (*textureUnit)++; - glActiveTexture(gTextureUnitsMap[textureSlot]); + Caches::getInstance().activeTexture(textureSlot); Texture* texture = mTexture; mTexture = NULL; @@ -223,7 +218,7 @@ void SkiaLinearGradientShader::describe(ProgramDescription& description, void SkiaLinearGradientShader::setupProgram(Program* program, const mat4& modelView, const Snapshot& snapshot, GLuint* textureUnit) { GLuint textureSlot = (*textureUnit)++; - glActiveTexture(gTextureUnitsMap[textureSlot]); + Caches::getInstance().activeTexture(textureSlot); Texture* texture = mGradientCache->get(mColors, mPositions, mCount, mTileX); @@ -335,7 +330,7 @@ void SkiaSweepGradientShader::describe(ProgramDescription& description, void SkiaSweepGradientShader::setupProgram(Program* program, const mat4& modelView, const Snapshot& snapshot, GLuint* textureUnit) { GLuint textureSlot = (*textureUnit)++; - glActiveTexture(gTextureUnitsMap[textureSlot]); + Caches::getInstance().activeTexture(textureSlot); Texture* texture = mGradientCache->get(mColors, mPositions, mCount); |