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

Unified Diff: cc/test/fake_content_layer_client.cc

Issue 519583003: Use the solid color detection to create solid layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added another test to make sure the tilings are cleared correctly Created 6 years, 3 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
Index: cc/test/fake_content_layer_client.cc
diff --git a/cc/test/fake_content_layer_client.cc b/cc/test/fake_content_layer_client.cc
index 9f75d8920bb69d52c49eb5be432425a9fb2592ac..8b17e436551ceb490d2276bc0f47080b199a84b9 100644
--- a/cc/test/fake_content_layer_client.cc
+++ b/cc/test/fake_content_layer_client.cc
@@ -10,7 +10,10 @@
namespace cc {
FakeContentLayerClient::FakeContentLayerClient()
- : paint_all_opaque_(false), last_canvas_(NULL) {}
+ : paint_all_opaque_(false),
+ fill_with_nonsolid_color_(false),
+ last_canvas_(NULL) {
+}
FakeContentLayerClient::~FakeContentLayerClient() {
}
@@ -42,6 +45,19 @@ void FakeContentLayerClient::PaintContents(
it != draw_bitmaps_.end(); ++it) {
canvas->drawBitmap(it->bitmap, it->point.x(), it->point.y(), &it->paint);
}
+
+ // Add a rectangle to the middle that doesn't fill |paint_rect| so that solid
+ // color analysis will fail.
+ if (fill_with_nonsolid_color_) {
+ gfx::RectF draw_rect = paint_rect;
+ draw_rect.Inset(draw_rect.width() / 4.0f, draw_rect.height() / 4.0f);
+ SkPaint paint;
+ canvas->drawRectCoords(draw_rect.x(),
+ draw_rect.y(),
+ draw_rect.right(),
+ draw_rect.bottom(),
+ paint);
+ }
}
bool FakeContentLayerClient::FillsBoundsCompletely() const { return false; }

Powered by Google App Engine
This is Rietveld 408576698