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

Unified Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 14417014: cc: Add tile-free software compositing mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to 199251 Created 7 years, 7 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/picture_layer_impl.cc ('k') | cc/output/direct_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl_unittest.cc
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index 54c37f8eab9761a012312b85a3c293268dcc638d..1fd20f1faead7641adcfcd7e80ba1d4d01b1b687 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "cc/layers/append_quads_data.h"
#include "cc/layers/picture_layer.h"
#include "cc/test/fake_content_layer_client.h"
#include "cc/test/fake_impl_proxy.h"
@@ -14,6 +15,7 @@
#include "cc/test/fake_picture_pile_impl.h"
#include "cc/test/geometry_test_utils.h"
#include "cc/test/impl_side_painting_settings.h"
+#include "cc/test/mock_quad_culler.h"
#include "cc/trees/layer_tree_impl.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkDevice.h"
@@ -826,5 +828,34 @@ TEST_F(PictureLayerImplTest, ClampSingleTileToToMaxTileSize) {
EXPECT_GE(140, tile->content_rect().height());
}
+TEST_F(PictureLayerImplTest, DisallowTileDrawQuads) {
+ MockQuadCuller quad_culler;
+
+ gfx::Size tile_size(400, 400);
+ gfx::Size layer_bounds(1300, 1900);
+
+ scoped_refptr<FakePicturePileImpl> pending_pile =
+ FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
+ scoped_refptr<FakePicturePileImpl> active_pile =
+ FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
+
+ SetupTrees(pending_pile, active_pile);
+
+ active_layer_->SetContentBounds(layer_bounds);
+ active_layer_->draw_properties().visible_content_rect =
+ gfx::Rect(layer_bounds);
+
+ gfx::Rect layer_invalidation(150, 200, 30, 180);
+ Region invalidation(layer_invalidation);
+ AddDefaultTilingsWithInvalidation(invalidation);
+
+ AppendQuadsData data;
+ data.allow_tile_draw_quads = false;
+ active_layer_->AppendQuads(&quad_culler, &data);
+
+ ASSERT_EQ(1U, quad_culler.quad_list().size());
+ EXPECT_EQ(DrawQuad::PICTURE_CONTENT, quad_culler.quad_list()[0]->material);
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/output/direct_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698