summaryrefslogtreecommitdiffstats
path: root/cc/test/render_pass_test_common.cc
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-09 03:23:05 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-09 03:23:05 +0000
commit4c0e3d72a5ccdc72aace7e29f3d7458eaf5b7224 (patch)
tree76ad09e5752e9e0fcb1d6759b33af281b5d6502a /cc/test/render_pass_test_common.cc
parentaa19e1206a6f005b719b3548aabd35126f361835 (diff)
downloadchromium_src-4c0e3d72a5ccdc72aace7e29f3d7458eaf5b7224.zip
chromium_src-4c0e3d72a5ccdc72aace7e29f3d7458eaf5b7224.tar.gz
chromium_src-4c0e3d72a5ccdc72aace7e29f3d7458eaf5b7224.tar.bz2
cc: Implement DelegatingRender::drawFrame() method.
The method sends the render passes it is given to the parent compositor via the output surface. It should include a valid frame metadata with it. Tests: DelegatingRendererTestDraw.runSingleThread DelegatingRendererTestDraw.runMultiThread DelegatingRendererTestResources.runSingleThread DelegatingRendererTestResources.runMultiThread R=piman BUG=123444 Review URL: https://chromiumcodereview.appspot.com/11777025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175690 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/render_pass_test_common.cc')
-rw-r--r--cc/test/render_pass_test_common.cc113
1 files changed, 77 insertions, 36 deletions
diff --git a/cc/test/render_pass_test_common.cc b/cc/test/render_pass_test_common.cc
index b66ca4f..b0b2281 100644
--- a/cc/test/render_pass_test_common.cc
+++ b/cc/test/render_pass_test_common.cc
@@ -20,7 +20,7 @@
namespace cc {
void TestRenderPass::AppendOneOfEveryQuadType(
- cc::ResourceProvider* resourceProvider) {
+ cc::ResourceProvider* resourceProvider, RenderPass::Id child_pass) {
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};
@@ -31,6 +31,31 @@ void TestRenderPass::AppendOneOfEveryQuadType(
ResourceProvider::TextureUsageAny);
unsigned texture_id = ResourceProvider::ScopedReadLockGL(
resourceProvider, texture_resource).textureId();
+ cc::ResourceProvider::ResourceId resource1 =
+ resourceProvider->createResource(
+ gfx::Size(45, 5),
+ resourceProvider->bestTextureFormat(),
+ ResourceProvider::TextureUsageAny);
+ cc::ResourceProvider::ResourceId resource2 =
+ resourceProvider->createResource(
+ gfx::Size(346, 61),
+ resourceProvider->bestTextureFormat(),
+ ResourceProvider::TextureUsageAny);
+ cc::ResourceProvider::ResourceId resource3 =
+ resourceProvider->createResource(
+ gfx::Size(12, 134),
+ resourceProvider->bestTextureFormat(),
+ ResourceProvider::TextureUsageAny);
+ cc::ResourceProvider::ResourceId resource4 =
+ resourceProvider->createResource(
+ gfx::Size(56, 12),
+ resourceProvider->bestTextureFormat(),
+ ResourceProvider::TextureUsageAny);
+ cc::ResourceProvider::ResourceId resource5 =
+ resourceProvider->createResource(
+ gfx::Size(73, 26),
+ resourceProvider->bestTextureFormat(),
+ ResourceProvider::TextureUsageAny);
scoped_ptr<cc::SharedQuadState> shared_state = cc::SharedQuadState::Create();
shared_state->SetAll(gfx::Transform(),
@@ -65,19 +90,35 @@ void TestRenderPass::AppendOneOfEveryQuadType(
cc::IOSurfaceDrawQuad::FLIPPED);
AppendQuad(io_surface_quad.PassAs<DrawQuad>());
- scoped_ptr<cc::RenderPassDrawQuad> render_pass_quad =
- cc::RenderPassDrawQuad::Create();
- render_pass_quad->SetNew(shared_state.get(),
- rect,
- cc::RenderPass::Id(1, 1),
- false,
- 0,
- rect,
- gfx::RectF(),
- WebKit::WebFilterOperations(),
- skia::RefPtr<SkImageFilter>(),
- WebKit::WebFilterOperations());
- AppendQuad(render_pass_quad.PassAs<DrawQuad>());
+ if (child_pass.layer_id) {
+ scoped_ptr<cc::RenderPassDrawQuad> render_pass_quad =
+ cc::RenderPassDrawQuad::Create();
+ render_pass_quad->SetNew(shared_state.get(),
+ rect,
+ child_pass,
+ false,
+ resource5,
+ rect,
+ gfx::RectF(),
+ WebKit::WebFilterOperations(),
+ skia::RefPtr<SkImageFilter>(),
+ WebKit::WebFilterOperations());
+ AppendQuad(render_pass_quad.PassAs<DrawQuad>());
+
+ scoped_ptr<cc::RenderPassDrawQuad> render_pass_replica_quad =
+ cc::RenderPassDrawQuad::Create();
+ render_pass_replica_quad->SetNew(shared_state.get(),
+ rect,
+ child_pass,
+ true,
+ resource5,
+ rect,
+ gfx::RectF(),
+ WebKit::WebFilterOperations(),
+ skia::RefPtr<SkImageFilter>(),
+ WebKit::WebFilterOperations());
+ AppendQuad(render_pass_replica_quad.PassAs<DrawQuad>());
+ }
scoped_ptr<cc::SolidColorDrawQuad> solid_color_quad =
cc::SolidColorDrawQuad::Create();
@@ -100,7 +141,7 @@ void TestRenderPass::AppendOneOfEveryQuadType(
texture_quad->SetNew(shared_state.get(),
rect,
opaque_rect,
- texture_resource,
+ resource1,
false,
rect,
vertex_opacity,
@@ -110,16 +151,16 @@ void TestRenderPass::AppendOneOfEveryQuadType(
scoped_ptr<cc::TileDrawQuad> scaled_tile_quad =
cc::TileDrawQuad::Create();
scaled_tile_quad->SetNew(shared_state.get(),
- rect,
- opaque_rect,
- texture_resource,
- gfx::RectF(0, 0, 50, 50),
- gfx::Size(50, 50),
- false,
- false,
- false,
- false,
- false);
+ rect,
+ opaque_rect,
+ resource2,
+ gfx::RectF(0, 0, 50, 50),
+ gfx::Size(50, 50),
+ false,
+ false,
+ false,
+ false,
+ false);
AppendQuad(scaled_tile_quad.PassAs<DrawQuad>());
scoped_ptr<cc::SharedQuadState> transformed_state = shared_state->Copy();
@@ -129,16 +170,16 @@ void TestRenderPass::AppendOneOfEveryQuadType(
scoped_ptr<cc::TileDrawQuad> transformed_tile_quad =
cc::TileDrawQuad::Create();
transformed_tile_quad->SetNew(transformed_state.get(),
- rect,
- opaque_rect,
- texture_resource,
- gfx::RectF(0, 0, 100, 100),
- gfx::Size(100, 100),
- false,
- false,
- false,
- false,
- false);
+ rect,
+ opaque_rect,
+ resource3,
+ gfx::RectF(0, 0, 100, 100),
+ gfx::Size(100, 100),
+ false,
+ false,
+ false,
+ false,
+ false);
AppendQuad(transformed_tile_quad.PassAs<DrawQuad>());
scoped_ptr<cc::TileDrawQuad> tile_quad =
@@ -146,7 +187,7 @@ void TestRenderPass::AppendOneOfEveryQuadType(
tile_quad->SetNew(shared_state.get(),
rect,
opaque_rect,
- texture_resource,
+ resource4,
gfx::RectF(0, 0, 100, 100),
gfx::Size(100, 100),
false,