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

Unified Diff: cc/test/layer_test_common.h

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/layers/texture_layer_impl_unittest.cc ('k') | cc/test/layer_test_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_test_common.h
diff --git a/cc/test/layer_test_common.h b/cc/test/layer_test_common.h
index 63079c32a7d5f89de0b4b0ebd50a018473a2ca7b..a1ca5379481ed61114c979e3ed11da9f71ad07bc 100644
--- a/cc/test/layer_test_common.h
+++ b/cc/test/layer_test_common.h
@@ -8,6 +8,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "cc/test/fake_layer_tree_host.h"
+#include "cc/test/mock_quad_culler.h"
#include "cc/trees/layer_tree_host_impl.h"
#define EXPECT_SET_NEEDS_COMMIT(expect, code_to_test) \
@@ -27,7 +28,9 @@
namespace gfx { class Rect; }
namespace cc {
+class OutputSurface;
class QuadList;
+class ResourceProvider;
class LayerTestCommon {
public:
@@ -55,16 +58,30 @@ class LayerTestCommon {
return ptr;
}
- void CalcDrawProps(const gfx::Size& viewport_size) {
- LayerImplList layer_list;
- LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
- root_layer_impl_.get(), viewport_size, &layer_list);
- LayerTreeHostCommon::CalculateDrawProperties(&inputs);
+ template <typename T, typename A>
+ T* AddChildToRoot(A a) {
+ scoped_ptr<T> layer = T::Create(host_->host_impl()->active_tree(), 2, a);
+ T* ptr = layer.get();
+ root_layer_impl_->AddChild(layer.template PassAs<LayerImpl>());
+ return ptr;
+ }
+
+ void CalcDrawProps(const gfx::Size& viewport_size);
+ void AppendQuadsWithOcclusion(LayerImpl* layer_impl,
+ const gfx::Rect& occluded);
+
+ OutputSurface* output_surface() const {
+ return host_->host_impl()->output_surface();
+ }
+ ResourceProvider* resource_provider() const {
+ return host_->host_impl()->resource_provider();
}
+ const QuadList& quad_list() const { return quad_culler_.quad_list(); }
private:
scoped_ptr<FakeLayerTreeHost> host_;
scoped_ptr<LayerImpl> root_layer_impl_;
+ MockQuadCuller quad_culler_;
};
};
« no previous file with comments | « cc/layers/texture_layer_impl_unittest.cc ('k') | cc/test/layer_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698