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

Unified Diff: cc/layers/texture_layer_impl_unittest.cc

Issue 1175113010: cc: Rename visible_content_rect and content stuff on quads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename-visible-content-rect: moreandroid Created 5 years, 6 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/layers/texture_layer_impl.cc ('k') | cc/layers/texture_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/texture_layer_impl_unittest.cc
diff --git a/cc/layers/texture_layer_impl_unittest.cc b/cc/layers/texture_layer_impl_unittest.cc
index d3f660e5693e6a244fcf0e391c8b3e74f487af7d..27efd971502dc2a2012ae7955392532d052cf4d7 100644
--- a/cc/layers/texture_layer_impl_unittest.cc
+++ b/cc/layers/texture_layer_impl_unittest.cc
@@ -17,6 +17,32 @@ void IgnoreCallback(uint32 sync_point,
BlockingTaskRunner* main_thread_task_runner) {
}
+TEST(TextureLayerImplTest, VisibleOpaqueRegion) {
+ const gfx::Size layer_bounds(100, 100);
+ const gfx::Rect layer_rect(layer_bounds);
+ const Region layer_region(layer_rect);
+
+ LayerTestCommon::LayerImplTest impl;
+
+ TextureLayerImpl* layer = impl.AddChildToRoot<TextureLayerImpl>();
+ layer->SetBounds(layer_bounds);
+ layer->draw_properties().visible_layer_rect = layer_rect;
+ layer->SetBlendBackgroundColor(true);
+
+ // Verify initial conditions.
+ EXPECT_FALSE(layer->contents_opaque());
+ EXPECT_EQ(0u, layer->background_color());
+ EXPECT_EQ(Region().ToString(), layer->VisibleOpaqueRegion().ToString());
+
+ // Opaque background.
+ layer->SetBackgroundColor(SK_ColorWHITE);
+ EXPECT_EQ(layer_region.ToString(), layer->VisibleOpaqueRegion().ToString());
+
+ // Transparent background.
+ layer->SetBackgroundColor(SkColorSetARGB(100, 255, 255, 255));
+ EXPECT_EQ(Region().ToString(), layer->VisibleOpaqueRegion().ToString());
+}
+
TEST(TextureLayerImplTest, Occlusion) {
gfx::Size layer_size(1000, 1000);
gfx::Size viewport_size(1000, 1000);
@@ -50,7 +76,7 @@ TEST(TextureLayerImplTest, Occlusion) {
{
SCOPED_TRACE("Full occlusion");
- gfx::Rect occluded(texture_layer_impl->visible_content_rect());
+ gfx::Rect occluded(texture_layer_impl->visible_layer_rect());
impl.AppendQuadsWithOcclusion(texture_layer_impl, occluded);
LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect());
« no previous file with comments | « cc/layers/texture_layer_impl.cc ('k') | cc/layers/texture_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698