diff options
Diffstat (limited to 'cc/test')
-rw-r--r-- | cc/test/layer_tree_pixel_test.cc | 28 | ||||
-rw-r--r-- | cc/test/layer_tree_pixel_test.h | 5 |
2 files changed, 33 insertions, 0 deletions
diff --git a/cc/test/layer_tree_pixel_test.cc b/cc/test/layer_tree_pixel_test.cc index 87cbd8f..d4b3701 100644 --- a/cc/test/layer_tree_pixel_test.cc +++ b/cc/test/layer_tree_pixel_test.cc @@ -90,6 +90,34 @@ scoped_refptr<SolidColorLayer> LayerTreePixelTest::CreateSolidColorLayer( return layer; } +scoped_refptr<SolidColorLayer> LayerTreePixelTest:: + CreateSolidColorLayerWithBorder( + gfx::Rect rect, SkColor color, int border_width, SkColor border_color) { + scoped_refptr<SolidColorLayer> layer = CreateSolidColorLayer(rect, color); + scoped_refptr<SolidColorLayer> border_top = CreateSolidColorLayer( + gfx::Rect(0, 0, rect.width(), border_width), border_color); + scoped_refptr<SolidColorLayer> border_left = CreateSolidColorLayer( + gfx::Rect(0, + border_width, + border_width, + rect.height() - border_width * 2), + border_color); + scoped_refptr<SolidColorLayer> border_right = CreateSolidColorLayer( + gfx::Rect(rect.width() - border_width, + border_width, + border_width, + rect.height() - border_width * 2), + border_color); + scoped_refptr<SolidColorLayer> border_bottom = CreateSolidColorLayer( + gfx::Rect(0, rect.height() - border_width, rect.width(), border_width), + border_color); + layer->AddChild(border_top); + layer->AddChild(border_left); + layer->AddChild(border_right); + layer->AddChild(border_bottom); + return layer; +} + void LayerTreePixelTest::RunPixelTest( scoped_refptr<Layer> content_root, base::FilePath file_name) diff --git a/cc/test/layer_tree_pixel_test.h b/cc/test/layer_tree_pixel_test.h index 4682d9e..58ec11f 100644 --- a/cc/test/layer_tree_pixel_test.h +++ b/cc/test/layer_tree_pixel_test.h @@ -34,6 +34,11 @@ class LayerTreePixelTest : public ThreadedTest { scoped_refptr<SolidColorLayer> CreateSolidColorLayer(gfx::Rect rect, SkColor color); + scoped_refptr<SolidColorLayer> CreateSolidColorLayerWithBorder( + gfx::Rect rect, + SkColor color, + int border_width, + SkColor border_color); void RunPixelTest(scoped_refptr<Layer> content_root, base::FilePath file_name); |