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

Unified Diff: cc/raster/tile_task_worker_pool.cc

Issue 1287523002: cc: Remove the gradient check from skipping images for low res tiles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/raster/tile_task_worker_pool.cc
diff --git a/cc/raster/tile_task_worker_pool.cc b/cc/raster/tile_task_worker_pool.cc
index f9862fbab1a203c56774038e5a86f0718787630f..2c16c14caae21e56571b5e7788030ed538292871 100644
--- a/cc/raster/tile_task_worker_pool.cc
+++ b/cc/raster/tile_task_worker_pool.cc
@@ -157,23 +157,20 @@ static bool IsSupportedPlaybackToMemoryFormat(ResourceFormat format) {
class SkipImageFilter : public SkDrawFilter {
public:
bool PaintHasBitmap(const SkPaint& paint) {
vmpstr 2015/08/10 21:27:29 Remove?
danakj 2015/08/10 21:31:10 Oops ya removed.
- SkShader* shader = paint.getShader();
- if (!shader)
- return false;
- if (shader->asAGradient(nullptr) == SkShader::kNone_GradientType)
- return false;
- if (shader->asABitmap(nullptr, nullptr, nullptr) !=
- SkShader::kNone_BitmapType)
- return true;
- return false;
}
bool filter(SkPaint* paint, Type type) override {
if (type == kBitmap_Type)
return false;
- if (PaintHasBitmap(*paint))
- return false;
- return true;
+
+ SkShader* shader = paint->getShader();
+ if (!shader)
+ return true;
+ SkShader::BitmapType type = shader->asABitmap(nullptr, nullptr, nullptr);
+ // The kDefault_BitmapType is returned for images. Other bitmap types are
+ // simply bitmap representations of colors such as gradients. So, we can
+ // return true and draw for any case except kDefault_BitmapType.
+ return type != SkShader::kDefault_BitmapType;
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698