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

Unified Diff: cc/test/layer_tree_pixel_resource_test.cc

Issue 2507963003: Pass correct texture hint for GPU raster (Closed)
Patch Set: rebase Created 4 years, 1 month 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_pixel_resource_test.h ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_tree_pixel_resource_test.cc
diff --git a/cc/test/layer_tree_pixel_resource_test.cc b/cc/test/layer_tree_pixel_resource_test.cc
index e31ff2813cfcc79296519c86e58bb97e7d7bffc8..af7ed73b2e0cdf3b7c9a38a2fc50483b600de902 100644
--- a/cc/test/layer_tree_pixel_resource_test.cc
+++ b/cc/test/layer_tree_pixel_resource_test.cc
@@ -44,6 +44,7 @@ LayerTreeHostPixelResourceTest::LayerTreeHostPixelResourceTest(
PixelResourceTestCase test_case)
: draw_texture_target_(GL_INVALID_VALUE),
raster_buffer_provider_type_(RASTER_BUFFER_PROVIDER_TYPE_BITMAP),
+ texture_hint_(ResourceProvider::TEXTURE_HINT_IMMUTABLE),
initialized_(false),
test_case_(test_case) {
InitializeFromTestCase(test_case);
@@ -64,41 +65,49 @@ void LayerTreeHostPixelResourceTest::InitializeFromTestCase(
test_type_ = PIXEL_TEST_SOFTWARE;
draw_texture_target_ = GL_INVALID_VALUE;
raster_buffer_provider_type_ = RASTER_BUFFER_PROVIDER_TYPE_BITMAP;
+ texture_hint_ = ResourceProvider::TEXTURE_HINT_IMMUTABLE;
return;
case GL_GPU_RASTER_2D_DRAW:
test_type_ = PIXEL_TEST_GL;
draw_texture_target_ = GL_TEXTURE_2D;
raster_buffer_provider_type_ = RASTER_BUFFER_PROVIDER_TYPE_GPU;
+ texture_hint_ = ResourceProvider::TEXTURE_HINT_IMMUTABLE_FRAMEBUFFER;
return;
case GL_ONE_COPY_2D_STAGING_2D_DRAW:
test_type_ = PIXEL_TEST_GL;
draw_texture_target_ = GL_TEXTURE_2D;
raster_buffer_provider_type_ = RASTER_BUFFER_PROVIDER_TYPE_ONE_COPY;
+ texture_hint_ = ResourceProvider::TEXTURE_HINT_IMMUTABLE;
return;
case GL_ONE_COPY_RECT_STAGING_2D_DRAW:
test_type_ = PIXEL_TEST_GL;
draw_texture_target_ = GL_TEXTURE_2D;
raster_buffer_provider_type_ = RASTER_BUFFER_PROVIDER_TYPE_ONE_COPY;
+ texture_hint_ = ResourceProvider::TEXTURE_HINT_IMMUTABLE;
return;
case GL_ONE_COPY_EXTERNAL_STAGING_2D_DRAW:
test_type_ = PIXEL_TEST_GL;
draw_texture_target_ = GL_TEXTURE_2D;
raster_buffer_provider_type_ = RASTER_BUFFER_PROVIDER_TYPE_ONE_COPY;
+ texture_hint_ = ResourceProvider::TEXTURE_HINT_IMMUTABLE;
return;
case GL_ZERO_COPY_2D_DRAW:
test_type_ = PIXEL_TEST_GL;
draw_texture_target_ = GL_TEXTURE_2D;
raster_buffer_provider_type_ = RASTER_BUFFER_PROVIDER_TYPE_ZERO_COPY;
+ texture_hint_ = ResourceProvider::TEXTURE_HINT_IMMUTABLE;
return;
case GL_ZERO_COPY_RECT_DRAW:
test_type_ = PIXEL_TEST_GL;
draw_texture_target_ = GL_TEXTURE_RECTANGLE_ARB;
raster_buffer_provider_type_ = RASTER_BUFFER_PROVIDER_TYPE_ZERO_COPY;
+ texture_hint_ = ResourceProvider::TEXTURE_HINT_IMMUTABLE;
return;
case GL_ZERO_COPY_EXTERNAL_DRAW:
test_type_ = PIXEL_TEST_GL;
draw_texture_target_ = GL_TEXTURE_EXTERNAL_OES;
raster_buffer_provider_type_ = RASTER_BUFFER_PROVIDER_TYPE_ZERO_COPY;
+ texture_hint_ = ResourceProvider::TEXTURE_HINT_IMMUTABLE;
return;
}
NOTREACHED();
@@ -124,8 +133,9 @@ void LayerTreeHostPixelResourceTest::CreateResourceAndRasterBufferProvider(
int max_staging_buffer_usage_in_bytes = 32 * 1024 * 1024;
// Create resource pool.
- *resource_pool = ResourcePool::Create(resource_provider, task_runner,
- ResourcePool::kDefaultExpirationDelay);
+ *resource_pool =
+ ResourcePool::Create(resource_provider, task_runner, texture_hint_,
+ ResourcePool::kDefaultExpirationDelay);
switch (raster_buffer_provider_type_) {
case RASTER_BUFFER_PROVIDER_TYPE_BITMAP:
« no previous file with comments | « cc/test/layer_tree_pixel_resource_test.h ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698