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

Unified Diff: cc/layer_tree_host_impl_unittest.cc

Issue 11622008: cc: Defer texture allocation (to allow async allocations). (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix remaining tests. 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
Index: cc/layer_tree_host_impl_unittest.cc
diff --git a/cc/layer_tree_host_impl_unittest.cc b/cc/layer_tree_host_impl_unittest.cc
index d439760e929e0a51805d9c482ea7ee3d8ba2826d..f6d357c4dcbc0e020286919645d7348c4828f12b 100644
--- a/cc/layer_tree_host_impl_unittest.cc
+++ b/cc/layer_tree_host_impl_unittest.cc
@@ -1048,6 +1048,7 @@ private:
setSkipsDraw(skipsDraw);
if (!tileMissing) {
ResourceProvider::ResourceId resource = resourceProvider->createResource(gfx::Size(), GL_RGBA, ResourceProvider::TextureUsageAny);
+ resourceProvider->allocateForTesting(resource);
pushTileProperties(0, 0, resource, gfx::Rect(), false);
}
if (animating)
@@ -1673,6 +1674,7 @@ private:
, m_quadVisibleRect(5, 5, 5, 5)
, m_resourceId(resourceProvider->createResource(gfx::Size(1, 1), GL_RGBA, ResourceProvider::TextureUsageAny))
{
+ resourceProvider->allocateForTesting(m_resourceId);
setAnchorPoint(gfx::PointF(0, 0));
setBounds(gfx::Size(10, 10));
setContentBounds(gfx::Size(10, 10));
@@ -2747,9 +2749,15 @@ public:
ResourceProvider::TextureUsageHint hint = ResourceProvider::TextureUsageAny;
setScrollbarGeometry(ScrollbarGeometryFixedThumb::create(FakeWebScrollbarThemeGeometryNonEmpty::create()));
- setBackTrackResourceId(provider->createResource(size, format, hint));
- setForeTrackResourceId(provider->createResource(size, format, hint));
- setThumbResourceId(provider->createResource(size, format, hint));
+ ResourceProvider::ResourceId backId = provider->createResource(size, format, hint);
+ ResourceProvider::ResourceId foreId = provider->createResource(size, format, hint);
+ ResourceProvider::ResourceId thumbId = provider->createResource(size, format, hint);
+ provider->allocateForTesting(backId);
+ provider->allocateForTesting(foreId);
+ provider->allocateForTesting(thumbId);
+ setBackTrackResourceId(backId);
+ setForeTrackResourceId(foreId);
+ setThumbResourceId(thumbId);
}
protected:
@@ -2762,6 +2770,7 @@ protected:
static inline scoped_ptr<RenderPass> createRenderPassWithResource(ResourceProvider* provider)
{
ResourceProvider::ResourceId resourceId = provider->createResource(gfx::Size(1, 1), GL_RGBA, ResourceProvider::TextureUsageAny);
+ provider->allocateForTesting(resourceId);
scoped_ptr<TestRenderPass> pass = TestRenderPass::Create();
pass->SetNew(RenderPass::Id(1, 1), gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1), gfx::Transform());

Powered by Google App Engine
This is Rietveld 408576698