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

Unified Diff: cc/test/render_pass_test_common.cc

Issue 13445009: cc: Move video upload to VideoResourceUpdater. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: consume textures that were produced Created 7 years, 8 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
« no previous file with comments | « cc/resources/video_resource_updater.cc ('k') | cc/test/test_web_graphics_context_3d.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/render_pass_test_common.cc
diff --git a/cc/test/render_pass_test_common.cc b/cc/test/render_pass_test_common.cc
index 7ceaef919b821c9b0294036fae9c95fa9e056dd3..c4f6310bcbfeb49a716e42831c9d547fcf5db410 100644
--- a/cc/test/render_pass_test_common.cc
+++ b/cc/test/render_pass_test_common.cc
@@ -33,14 +33,6 @@ void TestRenderPass::AppendOneOfEveryQuadType(
gfx::Rect rect(0, 0, 100, 100);
gfx::Rect opaque_rect(10, 10, 80, 80);
const float vertex_opacity[] = {1.0f, 1.0f, 1.0f, 1.0f};
- cc::ResourceProvider::ResourceId texture_resource =
- resource_provider->CreateResource(
- gfx::Size(20, 12),
- resource_provider->best_texture_format(),
- ResourceProvider::TextureUsageAny);
- resource_provider->AllocateForTesting(texture_resource);
- unsigned texture_id = ResourceProvider::ScopedReadLockGL(
- resource_provider, texture_resource).texture_id();
cc::ResourceProvider::ResourceId resource1 =
resource_provider->CreateResource(
gfx::Size(45, 5),
@@ -71,6 +63,18 @@ void TestRenderPass::AppendOneOfEveryQuadType(
resource_provider->best_texture_format(),
ResourceProvider::TextureUsageAny);
resource_provider->AllocateForTesting(resource5);
+ cc::ResourceProvider::ResourceId resource6 =
+ resource_provider->CreateResource(
+ gfx::Size(64, 92),
+ resource_provider->best_texture_format(),
+ ResourceProvider::TextureUsageAny);
+ resource_provider->AllocateForTesting(resource6);
+ cc::ResourceProvider::ResourceId resource7 =
+ resource_provider->CreateResource(
+ gfx::Size(9, 14),
+ resource_provider->best_texture_format(),
+ ResourceProvider::TextureUsageAny);
+ resource_provider->AllocateForTesting(resource7);
scoped_ptr<cc::SharedQuadState> shared_state = cc::SharedQuadState::Create();
shared_state->SetAll(gfx::Transform(),
@@ -101,7 +105,7 @@ void TestRenderPass::AppendOneOfEveryQuadType(
rect,
opaque_rect,
gfx::Size(50, 50),
- texture_id,
+ resource7,
cc::IOSurfaceDrawQuad::FLIPPED);
AppendQuad(io_surface_quad.PassAs<DrawQuad>());
@@ -147,7 +151,7 @@ void TestRenderPass::AppendOneOfEveryQuadType(
stream_video_quad->SetNew(shared_state.get(),
rect,
opaque_rect,
- texture_id,
+ resource6,
gfx::Transform());
AppendQuad(stream_video_quad.PassAs<DrawQuad>());
@@ -202,16 +206,14 @@ void TestRenderPass::AppendOneOfEveryQuadType(
false);
AppendQuad(tile_quad.PassAs<DrawQuad>());
- cc::VideoLayerImpl::FramePlane planes[3];
+ ResourceProvider::ResourceId plane_resources[3];
for (int i = 0; i < 3; ++i) {
- planes[i].resource_id =
+ plane_resources[i] =
resource_provider->CreateResource(
gfx::Size(20, 12),
resource_provider->best_texture_format(),
ResourceProvider::TextureUsageAny);
- resource_provider->AllocateForTesting(planes[i].resource_id);
- planes[i].size = gfx::Size(100, 100);
- planes[i].format = GL_LUMINANCE;
+ resource_provider->AllocateForTesting(plane_resources[i]);
}
scoped_ptr<cc::YUVVideoDrawQuad> yuv_quad =
cc::YUVVideoDrawQuad::Create();
@@ -219,9 +221,9 @@ void TestRenderPass::AppendOneOfEveryQuadType(
rect,
opaque_rect,
gfx::Size(100, 100),
- planes[0],
- planes[1],
- planes[2]);
+ plane_resources[0],
+ plane_resources[1],
+ plane_resources[2]);
AppendQuad(yuv_quad.PassAs<DrawQuad>());
AppendSharedQuadState(transformed_state.Pass());
« no previous file with comments | « cc/resources/video_resource_updater.cc ('k') | cc/test/test_web_graphics_context_3d.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698