diff options
Diffstat (limited to 'src/core/SkDraw.cpp')
-rw-r--r-- | src/core/SkDraw.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp index 3035afe1ef..f71187e74a 100644 --- a/src/core/SkDraw.cpp +++ b/src/core/SkDraw.cpp @@ -1228,13 +1228,6 @@ void SkDraw::drawBitmap(const SkBitmap& bitmap, const SkMatrix& prematrix, } } - // only lock the pixels if we passed the clip and bounder tests - SkAutoLockPixels alp(bitmap); - // after the lock, check if we are valid - if (!bitmap.readyToDraw()) { - return; - } - if (bitmap.getConfig() != SkBitmap::kA8_Config && just_translate(matrix, bitmap)) { int ix = SkScalarRound(matrix.getTranslateX()); @@ -2279,7 +2272,7 @@ public: bool setup(const SkPoint pts[], const SkColor colors[], int, int, int); - virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count); + virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVERRIDE; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTriColorShader) @@ -2406,7 +2399,7 @@ void SkDraw::drawVertices(SkCanvas::VertexMode vmode, int count, if (NULL != colors) { if (NULL == textures) { // just colors (no texture) - p.setShader(&triShader); + shader = p.setShader(&triShader); } else { // colors * texture SkASSERT(shader); @@ -2421,6 +2414,7 @@ void SkDraw::drawVertices(SkCanvas::VertexMode vmode, int count, if (releaseMode) { xmode->unref(); } + shader = compose; } } @@ -2436,10 +2430,17 @@ void SkDraw::drawVertices(SkCanvas::VertexMode vmode, int count, savedLocalM = shader->getLocalMatrix(); } + // do we need this? triShader should have been installed in p, either + // directly or indirectly (using compose shader), so its setContext + // should have already been called. if (NULL != colors) { + SkASSERT(triShader.setContextHasBeenCalled()); +#if 0 + if (!triShader.setContext(*fBitmap, p, *fMatrix)) { colors = NULL; } +#endif } while (vertProc(&state)) { @@ -2448,6 +2449,7 @@ void SkDraw::drawVertices(SkCanvas::VertexMode vmode, int count, tempM.postConcat(savedLocalM); shader->setLocalMatrix(tempM); // need to recal setContext since we changed the local matrix + shader->endContext(); if (!shader->setContext(*fBitmap, p, *fMatrix)) { continue; } |