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

Unified Diff: cc/layer_impl_unittest.cc

Issue 11529006: [cc] Fold more update calls into updateDrawProperties (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase yet again ughhh Created 8 years 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 | « no previous file | cc/layer_tree_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_impl_unittest.cc
diff --git a/cc/layer_impl_unittest.cc b/cc/layer_impl_unittest.cc
index 68a2fe03b1eca88e933d4cc354bb517713d0f658..8d691cfe4ebcecd3f3b2b813aa85bf0c042de80d 100644
--- a/cc/layer_impl_unittest.cc
+++ b/cc/layer_impl_unittest.cc
@@ -7,6 +7,7 @@
#include "cc/single_thread_proxy.h"
#include "cc/test/fake_impl_proxy.h"
#include "cc/test/fake_layer_tree_host_impl.h"
+#include "cc/test/fake_output_surface.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/effects/SkBlurImageFilter.h"
@@ -53,13 +54,13 @@ namespace {
#define VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(codeToTest) \
root->resetAllChangeTrackingForSubtree(); \
- hostImpl.resetNeedsUpdateDrawPropertiesForTesting(); \
+ hostImpl.forcePrepareToDraw(); \
codeToTest; \
EXPECT_TRUE(hostImpl.needsUpdateDrawProperties());
#define VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(codeToTest) \
root->resetAllChangeTrackingForSubtree(); \
- hostImpl.resetNeedsUpdateDrawPropertiesForTesting(); \
+ hostImpl.forcePrepareToDraw(); \
codeToTest; \
EXPECT_FALSE(hostImpl.needsUpdateDrawProperties());
@@ -73,6 +74,7 @@ TEST(LayerImplTest, verifyLayerChangesAreTrackedProperly)
// Create a simple LayerImpl tree:
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
+ EXPECT_TRUE(hostImpl.initializeRenderer(createFakeOutputSurface()));
scoped_ptr<LayerImpl> root = LayerImpl::create(hostImpl.activeTree(), 1);
root->addChild(LayerImpl::create(hostImpl.activeTree(), 2));
LayerImpl* child = root->children()[0];
@@ -169,6 +171,7 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties)
{
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
+ EXPECT_TRUE(hostImpl.initializeRenderer(createFakeOutputSurface()));
scoped_ptr<LayerImpl> root = LayerImpl::create(hostImpl.activeTree(), 1);
gfx::PointF arbitraryPointF = gfx::PointF(0.125f, 0.25f);
@@ -199,7 +202,7 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties)
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(root->scrollBy(arbitraryVector2d));
VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(root->scrollBy(gfx::Vector2d()));
root->setScrollDelta(gfx::Vector2d(0, 0));
- hostImpl.resetNeedsUpdateDrawPropertiesForTesting();
+ hostImpl.forcePrepareToDraw();
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(root->setScrollDelta(arbitraryVector2d));
VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(root->setScrollDelta(arbitraryVector2d));
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(root->setScrollOffset(arbitraryVector2d));
« no previous file with comments | « no previous file | cc/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698