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

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: Add perf test Created 7 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
Index: cc/test/layer_tree_test.cc
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc
index 7726142d229e510ec93a0e6e72e046db5ce3c3ad..f75e502b3d192c5802d426238dcd99959b8b1f36 100644
--- a/cc/test/layer_tree_test.cc
+++ b/cc/test/layer_tree_test.cc
@@ -29,10 +29,9 @@ using namespace WebKit;
namespace cc {
-TestHooks::TestHooks() {
- fake_client_.reset(
- new FakeLayerTreeHostClient(FakeLayerTreeHostClient::DIRECT_3D));
-}
+TestHooks::TestHooks()
+ : fake_client_(
+ new FakeLayerTreeHostClient(FakeLayerTreeHostClient::DIRECT_3D)) {}
TestHooks::~TestHooks() {}
@@ -105,8 +104,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;
@@ -118,8 +117,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;
}
@@ -409,7 +408,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);
}
@@ -420,6 +421,7 @@ void LayerTreeTest::SetupTree() {
}
void LayerTreeTest::Timeout() {
+ return;
enne (OOO) 2013/03/26 01:42:07 ಠ_ృ
danakj 2013/03/26 02:00:10 Haha.. Oops, was gdbing. We need a command line fl
danakj 2013/03/26 02:26:06 2013/03/26 02:00:10, danakj wrote:
timed_out_ = true;
EndTest();
}

Powered by Google App Engine
This is Rietveld 408576698