diff options
author | sky <sky@chromium.org> | 2015-08-18 14:46:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-18 21:46:45 +0000 |
commit | c4967eface72bc99452d8a83800c7cdd19a872ee (patch) | |
tree | 82ec25a98e098ab4e18afa46afd7cbdc2f984fe6 /cc/test/layer_tree_pixel_resource_test.cc | |
parent | 70e489415d055feba858a975443eee2f62e0e88e (diff) | |
download | chromium_src-c4967eface72bc99452d8a83800c7cdd19a872ee.zip chromium_src-c4967eface72bc99452d8a83800c7cdd19a872ee.tar.gz chromium_src-c4967eface72bc99452d8a83800c7cdd19a872ee.tar.bz2 |
Revert of Re-land: cc: Use worker context for one-copy tile initialization. (patchset #29 id:560001 of https://codereview.chromium.org/1230203007/ )
Reason for revert:
Sorry Dave. I'm reverting as this broke mandoline. To see the breakage build mandoline:all, and run with:
mandoline --oopif-always-create-new-frame-tree http://phuang.github.io/iframe.html .
We do have mandoline tests that run, but they run with the code path gfx::GLSurfaceTestSupport::InitializeOneOff(), which is why they likely still pass. I'll see about making the tests not run with that config.
Original issue's description:
> Re-land: cc: Use worker context for one-copy tile initialization.
>
> This moves management of staging resources to
> OneCopyTileTaskWorkerPool class. This makes it possible
> to use a worker context to issue and detect when copy
> operations complete.
>
> BUG=490295
> TBR=jamesr@chromium.org, sky@chromium.org
> CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
>
> Committed: https://crrev.com/af0ab609b53c64ce43172be42e20e7ca8beab497
> Cr-Commit-Position: refs/heads/master@{#343947}
TBR=jamesr@chromium.org,kbr@chromium.org,piman@chromium.org,primiano@chromium.org,vmiura@chromium.org,vmpstr@chromium.org,reveman@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=490295
Review URL: https://codereview.chromium.org/1298143003
Cr-Commit-Position: refs/heads/master@{#344042}
Diffstat (limited to 'cc/test/layer_tree_pixel_resource_test.cc')
-rw-r--r-- | cc/test/layer_tree_pixel_resource_test.cc | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/cc/test/layer_tree_pixel_resource_test.cc b/cc/test/layer_tree_pixel_resource_test.cc index 3b52487..bc323f1 100644 --- a/cc/test/layer_tree_pixel_resource_test.cc +++ b/cc/test/layer_tree_pixel_resource_test.cc @@ -45,7 +45,8 @@ bool IsTestCaseSupported(PixelResourceTestCase test_case) { LayerTreeHostPixelResourceTest::LayerTreeHostPixelResourceTest( PixelResourceTestCase test_case) - : draw_texture_target_(GL_INVALID_VALUE), + : staging_texture_target_(GL_INVALID_VALUE), + draw_texture_target_(GL_INVALID_VALUE), resource_pool_option_(BITMAP_TILE_TASK_WORKER_POOL), initialized_(false), test_case_(test_case) { @@ -53,10 +54,12 @@ LayerTreeHostPixelResourceTest::LayerTreeHostPixelResourceTest( } LayerTreeHostPixelResourceTest::LayerTreeHostPixelResourceTest() - : draw_texture_target_(GL_INVALID_VALUE), + : staging_texture_target_(GL_INVALID_VALUE), + draw_texture_target_(GL_INVALID_VALUE), resource_pool_option_(BITMAP_TILE_TASK_WORKER_POOL), initialized_(false), - test_case_(SOFTWARE) {} + test_case_(SOFTWARE) { +} void LayerTreeHostPixelResourceTest::InitializeFromTestCase( PixelResourceTestCase test_case) { @@ -65,46 +68,55 @@ void LayerTreeHostPixelResourceTest::InitializeFromTestCase( switch (test_case) { case SOFTWARE: test_type_ = PIXEL_TEST_SOFTWARE; + staging_texture_target_ = GL_INVALID_VALUE; draw_texture_target_ = GL_INVALID_VALUE; resource_pool_option_ = BITMAP_TILE_TASK_WORKER_POOL; return; case GL_GPU_RASTER_2D_DRAW: test_type_ = PIXEL_TEST_GL; + staging_texture_target_ = GL_INVALID_VALUE; draw_texture_target_ = GL_TEXTURE_2D; resource_pool_option_ = GPU_TILE_TASK_WORKER_POOL; return; case GL_ONE_COPY_2D_STAGING_2D_DRAW: test_type_ = PIXEL_TEST_GL; + staging_texture_target_ = GL_TEXTURE_2D; draw_texture_target_ = GL_TEXTURE_2D; resource_pool_option_ = ONE_COPY_TILE_TASK_WORKER_POOL; return; case GL_ONE_COPY_RECT_STAGING_2D_DRAW: test_type_ = PIXEL_TEST_GL; + staging_texture_target_ = GL_TEXTURE_RECTANGLE_ARB; draw_texture_target_ = GL_TEXTURE_2D; resource_pool_option_ = ONE_COPY_TILE_TASK_WORKER_POOL; return; case GL_ONE_COPY_EXTERNAL_STAGING_2D_DRAW: test_type_ = PIXEL_TEST_GL; + staging_texture_target_ = GL_TEXTURE_EXTERNAL_OES; draw_texture_target_ = GL_TEXTURE_2D; resource_pool_option_ = ONE_COPY_TILE_TASK_WORKER_POOL; return; case GL_ZERO_COPY_2D_DRAW: test_type_ = PIXEL_TEST_GL; + staging_texture_target_ = GL_INVALID_VALUE; draw_texture_target_ = GL_TEXTURE_2D; resource_pool_option_ = ZERO_COPY_TILE_TASK_WORKER_POOL; return; case GL_ZERO_COPY_RECT_DRAW: test_type_ = PIXEL_TEST_GL; + staging_texture_target_ = GL_INVALID_VALUE; draw_texture_target_ = GL_TEXTURE_RECTANGLE_ARB; resource_pool_option_ = ZERO_COPY_TILE_TASK_WORKER_POOL; return; case GL_ZERO_COPY_EXTERNAL_DRAW: test_type_ = PIXEL_TEST_GL; + staging_texture_target_ = GL_INVALID_VALUE; draw_texture_target_ = GL_TEXTURE_EXTERNAL_OES; resource_pool_option_ = ZERO_COPY_TILE_TASK_WORKER_POOL; return; case GL_ASYNC_UPLOAD_2D_DRAW: test_type_ = PIXEL_TEST_GL; + staging_texture_target_ = GL_INVALID_VALUE; draw_texture_target_ = GL_TEXTURE_2D; resource_pool_option_ = PIXEL_BUFFER_TILE_TASK_WORKER_POOL; return; @@ -115,7 +127,8 @@ void LayerTreeHostPixelResourceTest::InitializeFromTestCase( void LayerTreeHostPixelResourceTest::CreateResourceAndTileTaskWorkerPool( LayerTreeHostImpl* host_impl, scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, - scoped_ptr<ResourcePool>* resource_pool) { + scoped_ptr<ResourcePool>* resource_pool, + scoped_ptr<ResourcePool>* staging_resource_pool) { base::SingleThreadTaskRunner* task_runner = proxy()->HasImplThread() ? proxy()->ImplThreadTaskRunner() : proxy()->MainThreadTaskRunner(); @@ -127,7 +140,6 @@ void LayerTreeHostPixelResourceTest::CreateResourceAndTileTaskWorkerPool( ResourceProvider* resource_provider = host_impl->resource_provider(); size_t max_transfer_buffer_usage_bytes = 1024u * 1024u * 60u; int max_bytes_per_copy_operation = 1024 * 1024; - int max_staging_buffers = 32; switch (resource_pool_option_) { case BITMAP_TILE_TASK_WORKER_POOL: @@ -165,12 +177,15 @@ void LayerTreeHostPixelResourceTest::CreateResourceAndTileTaskWorkerPool( EXPECT_TRUE(context_provider); EXPECT_EQ(PIXEL_TEST_GL, test_type_); EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image); + // We need to create a staging resource pool when using copy rasterizer. + *staging_resource_pool = + ResourcePool::Create(resource_provider, staging_texture_target_); *resource_pool = ResourcePool::Create(resource_provider, draw_texture_target_); *tile_task_worker_pool = OneCopyTileTaskWorkerPool::Create( task_runner, task_graph_runner(), context_provider, resource_provider, - max_bytes_per_copy_operation, false, max_staging_buffers); + staging_resource_pool->get(), max_bytes_per_copy_operation, false); break; case PIXEL_BUFFER_TILE_TASK_WORKER_POOL: EXPECT_TRUE(context_provider); |