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

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: final merge 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
« no previous file with comments | « cc/test/fake_content_layer_client.h ('k') | cc/trees/layer_tree_host_pixeltest_readback.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 143f484348462cb0246855d91de048115ec90cb5..d97869cc0ac876efbb340ed4671460698ecca755 100644
--- a/cc/test/fake_content_layer_client.cc
+++ b/cc/test/fake_content_layer_client.cc
@@ -9,7 +9,8 @@
namespace cc {
-FakeContentLayerClient::FakeContentLayerClient() : last_canvas_(NULL) {
+FakeContentLayerClient::FakeContentLayerClient()
+ : fill_with_nonsolid_color_(false), last_canvas_(NULL) {
}
FakeContentLayerClient::~FakeContentLayerClient() {
@@ -38,6 +39,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; }
« no previous file with comments | « cc/test/fake_content_layer_client.h ('k') | cc/trees/layer_tree_host_pixeltest_readback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698