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

Unified Diff: cc/test/layer_tree_test.cc

Issue 12662021: cc: Don't draw and swap if the frame will not change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 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_tree_test.h ('k') | cc/trees/damage_tracker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_tree_test.cc
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc
index 2c4c8c84f723f5c9ffc9472cd5f5f42903ddd369..460bbddd1e54b7bd8ac91309c5e4f5b9eb7e49df 100644
--- a/cc/test/layer_tree_test.cc
+++ b/cc/test/layer_tree_test.cc
@@ -26,10 +26,9 @@
namespace cc {
-TestHooks::TestHooks() {
- fake_client_.reset(
- new FakeLayerTreeHostClient(FakeLayerTreeHostClient::DIRECT_3D));
-}
+TestHooks::TestHooks()
+ : fake_client_(
+ new FakeLayerTreeHostClient(FakeLayerTreeHostClient::DIRECT_3D)) {}
TestHooks::~TestHooks() {}
@@ -100,8 +99,8 @@ class LayerTreeHostImplForTesting : public LayerTreeHostImpl {
test_hooks_->TreeActivatedOnThread(this);
}
- virtual bool PrepareToDraw(FrameData* frame) OVERRIDE {
- bool result = LayerTreeHostImpl::PrepareToDraw(frame);
+ virtual bool PrepareToDraw(FrameData* frame, gfx::Rect damage_rect) OVERRIDE {
+ bool result = LayerTreeHostImpl::PrepareToDraw(frame, damage_rect);
if (!test_hooks_->PrepareToDrawOnThread(this, frame, result))
result = false;
return result;
@@ -113,8 +112,8 @@ class LayerTreeHostImplForTesting : public LayerTreeHostImpl {
test_hooks_->DrawLayersOnThread(this);
}
- virtual bool SwapBuffers() OVERRIDE {
- bool result = LayerTreeHostImpl::SwapBuffers();
+ virtual bool SwapBuffers(const LayerTreeHostImpl::FrameData& frame) OVERRIDE {
+ bool result = LayerTreeHostImpl::SwapBuffers(frame);
test_hooks_->SwapBuffersOnThread(this, result);
return result;
}
@@ -413,7 +412,9 @@ void LayerTreeTest::DoBeginTest() {
void LayerTreeTest::SetupTree() {
if (!layer_tree_host_->root_layer()) {
scoped_refptr<Layer> root_layer = Layer::Create();
+ root_layer->SetAnchorPoint(gfx::PointF());
root_layer->SetBounds(gfx::Size(1, 1));
+ root_layer->SetIsDrawable(true);
layer_tree_host_->SetRootLayer(root_layer);
}
« no previous file with comments | « cc/test/layer_tree_test.h ('k') | cc/trees/damage_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698