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

Unified Diff: cc/test/layer_test_common.cc

Issue 201153021: cc: Apply occlusion before creating quads in TextureLayerImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: append-texture: year Created 6 years, 9 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/layer_test_common.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_test_common.cc
diff --git a/cc/test/layer_test_common.cc b/cc/test/layer_test_common.cc
index 85fbf6b25d95e6931a732c1ef16dc79f2eb95ef5..31a16e1fe87b158f5751f09059dc4287e3c9d517 100644
--- a/cc/test/layer_test_common.cc
+++ b/cc/test/layer_test_common.cc
@@ -6,8 +6,11 @@
#include "cc/base/math_util.h"
#include "cc/base/region.h"
+#include "cc/layers/append_quads_data.h"
#include "cc/quads/draw_quad.h"
#include "cc/quads/render_pass.h"
+#include "cc/test/fake_output_surface.h"
+#include "cc/trees/layer_tree_host_common.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/point_conversions.h"
#include "ui/gfx/rect.h"
@@ -89,8 +92,32 @@ void LayerTestCommon::VerifyQuadsCoverRectWithOcclusion(
LayerTestCommon::LayerImplTest::LayerImplTest()
: host_(FakeLayerTreeHost::Create()),
root_layer_impl_(
- LayerImpl::Create(host_->host_impl()->active_tree(), 1)) {}
+ LayerImpl::Create(host_->host_impl()->active_tree(), 1)) {
+ scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d();
+ host_->host_impl()->InitializeRenderer(
+ output_surface.PassAs<OutputSurface>());
+}
LayerTestCommon::LayerImplTest::~LayerImplTest() {}
+void LayerTestCommon::LayerImplTest::CalcDrawProps(
+ const gfx::Size& viewport_size) {
+ LayerImplList layer_list;
+ LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
+ root_layer_impl_.get(), viewport_size, &layer_list);
+ LayerTreeHostCommon::CalculateDrawProperties(&inputs);
+}
+
+void LayerTestCommon::LayerImplTest::AppendQuadsWithOcclusion(
+ LayerImpl* layer_impl,
+ const gfx::Rect& occluded) {
+ AppendQuadsData data;
+
+ quad_culler_.clear_lists();
+ quad_culler_.set_occluded_content_rect(occluded);
+ layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider());
+ layer_impl->AppendQuads(&quad_culler_, &data);
+ layer_impl->DidDraw(resource_provider());
+}
+
} // namespace cc
« no previous file with comments | « cc/test/layer_test_common.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698