Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: src/core/SkBitmapProcShader.cpp

Issue 766283004: check (thread-tricky) colortable after we've copied the bitmap into a per-thread context (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkBitmapProcState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcShader.cpp
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp
index 2e42ef1b9a2e3e76d41ee59982600d92b2ccbdd4..2cfde655b8792791f150a78b210e071524a7f065 100644
--- a/src/core/SkBitmapProcShader.cpp
+++ b/src/core/SkBitmapProcShader.cpp
@@ -84,28 +84,7 @@ bool SkBitmapProcShader::isOpaque() const {
return fRawBitmap.isOpaque();
}
-static bool valid_for_drawing(const SkBitmap& bm) {
- if (0 == bm.width() || 0 == bm.height()) {
- return false; // nothing to draw
- }
- if (NULL == bm.pixelRef()) {
- return false; // no pixels to read
- }
- if (kIndex_8_SkColorType == bm.colorType()) {
- SkBitmap copy(bm); // Locking and unlocking pixels is not thread safe,
- SkAutoLockPixels alp(copy); // but we need to call it before getColorTable() is safe.
- if (!copy.getColorTable()) {
- return false;
- }
- }
- return true;
-}
-
SkShader::Context* SkBitmapProcShader::onCreateContext(const ContextRec& rec, void* storage) const {
- if (!fRawBitmap.getTexture() && !valid_for_drawing(fRawBitmap)) {
- return NULL;
- }
-
SkMatrix totalInverse;
// Do this first, so we know the matrix can be inverted.
if (!this->computeTotalInverse(rec, &totalInverse)) {
« no previous file with comments | « no previous file | src/core/SkBitmapProcState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698