diff options
author | Chris Craik <ccraik@google.com> | 2015-06-01 10:35:35 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2015-06-02 16:28:39 -0700 |
commit | 53e51e4aa933f9603587e1780f446c18816bf9be (patch) | |
tree | fc4701637c9e17fc2765c162b0b051f56bec68aa /libs/hwui/SkiaShader.cpp | |
parent | 1e47a8e096fc28dcab0a55bc4f2e6b747bfb1a07 (diff) | |
download | frameworks_base-53e51e4aa933f9603587e1780f446c18816bf9be.zip frameworks_base-53e51e4aa933f9603587e1780f446c18816bf9be.tar.gz frameworks_base-53e51e4aa933f9603587e1780f446c18816bf9be.tar.bz2 |
Handle shader matrix correctly when ignoring canvas transform
bug:20063841
Restores old SkShader matrix behavior from before the Glop refactor.
Many drawing operations draw without sending the canvas transform to
the GL shader. In such cases, we need to adapt the matrix sent to the
SkShader logic to invert the canvas transform that's built into
the mesh.
Change-Id: I42b6f59df36ce46436322b95bf9ad2140795ee58
Diffstat (limited to 'libs/hwui/SkiaShader.cpp')
-rw-r--r-- | libs/hwui/SkiaShader.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/libs/hwui/SkiaShader.cpp b/libs/hwui/SkiaShader.cpp index ecf8b6b..2cfb9e1 100644 --- a/libs/hwui/SkiaShader.cpp +++ b/libs/hwui/SkiaShader.cpp @@ -346,33 +346,28 @@ void applyLayer(Caches& caches, const SkiaShaderData::LayerShaderData& data) { glUniform2fv(caches.program().getUniform("textureDimension"), 1, &data.textureDimension[0]); } -void SkiaShader::store(Caches& caches, const SkShader* shader, const Matrix4& modelViewMatrix, +void SkiaShader::store(Caches& caches, const SkShader& shader, const Matrix4& modelViewMatrix, GLuint* textureUnit, ProgramDescription* description, SkiaShaderData* outData) { - if (!shader) { - outData->skiaShaderType = kNone_SkiaShaderType; - return; - } - - if (tryStoreGradient(caches, *shader, modelViewMatrix, + if (tryStoreGradient(caches, shader, modelViewMatrix, textureUnit, description, &outData->gradientData)) { outData->skiaShaderType = kGradient_SkiaShaderType; return; } - if (tryStoreBitmap(caches, *shader, modelViewMatrix, + if (tryStoreBitmap(caches, shader, modelViewMatrix, textureUnit, description, &outData->bitmapData)) { outData->skiaShaderType = kBitmap_SkiaShaderType; return; } - if (tryStoreCompose(caches, *shader, modelViewMatrix, + if (tryStoreCompose(caches, shader, modelViewMatrix, textureUnit, description, outData)) { outData->skiaShaderType = kCompose_SkiaShaderType; return; } - if (tryStoreLayer(caches, *shader, modelViewMatrix, + if (tryStoreLayer(caches, shader, modelViewMatrix, textureUnit, description, &outData->layerData)) { outData->skiaShaderType = kLayer_SkiaShaderType; } |