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

Side by Side Diff: cc/test/render_pass_test_common.cc

Issue 11411050: cc: Make the DrawQuad subclasses into struct-like classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/stream_video_draw_quad.cc ('k') | cc/texture_draw_quad.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/test/render_pass_test_common.h" 5 #include "cc/test/render_pass_test_common.h"
6 6
7 #include "cc/checkerboard_draw_quad.h" 7 #include "cc/checkerboard_draw_quad.h"
8 #include "cc/debug_border_draw_quad.h" 8 #include "cc/debug_border_draw_quad.h"
9 #include "cc/io_surface_draw_quad.h" 9 #include "cc/io_surface_draw_quad.h"
10 #include "cc/render_pass_draw_quad.h" 10 #include "cc/render_pass_draw_quad.h"
(...skipping 11 matching lines...) Expand all
22 using cc::DrawQuad; 22 using cc::DrawQuad;
23 using WebKit::WebTransformationMatrix; 23 using WebKit::WebTransformationMatrix;
24 24
25 void TestRenderPass::appendOneOfEveryQuadType(cc::ResourceProvider* resourceProv ider) 25 void TestRenderPass::appendOneOfEveryQuadType(cc::ResourceProvider* resourceProv ider)
26 { 26 {
27 gfx::Rect rect(0, 0, 100, 100); 27 gfx::Rect rect(0, 0, 100, 100);
28 gfx::Rect opaqueRect(10, 10, 80, 80); 28 gfx::Rect opaqueRect(10, 10, 80, 80);
29 cc::ResourceProvider::ResourceId textureResource = resourceProvider->createR esourceFromExternalTexture(1); 29 cc::ResourceProvider::ResourceId textureResource = resourceProvider->createR esourceFromExternalTexture(1);
30 scoped_ptr<cc::SharedQuadState> sharedState = cc::SharedQuadState::create(We bTransformationMatrix(), rect, rect, 1); 30 scoped_ptr<cc::SharedQuadState> sharedState = cc::SharedQuadState::create(We bTransformationMatrix(), rect, rect, 1);
31 31
32 appendQuad(cc::CheckerboardDrawQuad::create(sharedState.get(), rect, SK_Colo rRED).PassAs<DrawQuad>()); 32 scoped_ptr<cc::CheckerboardDrawQuad> checkerboardQuad = cc::CheckerboardDraw Quad::Create();
33 appendQuad(cc::DebugBorderDrawQuad::create(sharedState.get(), rect, SK_Color RED, 1).Pass().PassAs<DrawQuad>()); 33 checkerboardQuad->SetNew(sharedState.get(), rect, SK_ColorRED);
34 appendQuad(cc::IOSurfaceDrawQuad::create(sharedState.get(), rect, opaqueRect , gfx::Size(50, 50), 1, cc::IOSurfaceDrawQuad::Flipped).PassAs<DrawQuad>()); 34 appendQuad(checkerboardQuad.PassAs<DrawQuad>());
35 35
36 cc::RenderPass::Id passId(1, 1); 36 scoped_ptr<cc::DebugBorderDrawQuad> debugBorderQuad = cc::DebugBorderDrawQua d::Create();
37 appendQuad(cc::RenderPassDrawQuad::create(sharedState.get(), rect, passId, f alse, 0, rect, 0, 0, 0, 0).PassAs<DrawQuad>()); 37 debugBorderQuad->SetNew(sharedState.get(), rect, SK_ColorRED, 1);
38 appendQuad(debugBorderQuad.PassAs<DrawQuad>());
38 39
39 appendQuad(cc::SolidColorDrawQuad::create(sharedState.get(), rect, SK_ColorR ED).PassAs<DrawQuad>()); 40 scoped_ptr<cc::IOSurfaceDrawQuad> ioSurfaceQuad = cc::IOSurfaceDrawQuad::Cre ate();
40 appendQuad(cc::StreamVideoDrawQuad::create(sharedState.get(), rect, opaqueRe ct, 1, WebKit::WebTransformationMatrix()).PassAs<DrawQuad>()); 41 ioSurfaceQuad->SetNew(sharedState.get(), rect, opaqueRect, gfx::Size(50, 50) , 1, cc::IOSurfaceDrawQuad::FLIPPED);
41 appendQuad(cc::TextureDrawQuad::create(sharedState.get(), rect, opaqueRect, textureResource, false, rect, false).PassAs<DrawQuad>()); 42 appendQuad(ioSurfaceQuad.PassAs<DrawQuad>());
42 43
43 appendQuad(cc::TileDrawQuad::create(sharedState.get(), rect, opaqueRect, tex tureResource, gfx::RectF(0, 0, 100, 100), gfx::Size(100, 100), false, false, fal se, false, false).PassAs<DrawQuad>()); 44 scoped_ptr<cc::RenderPassDrawQuad> renderPassQuad = cc::RenderPassDrawQuad:: Create();
45 renderPassQuad->SetNew(sharedState.get(), rect, cc::RenderPass::Id(1, 1), fa lse, 0, rect, 0, 0, 0, 0);
46 appendQuad(renderPassQuad.PassAs<DrawQuad>());
47
48 scoped_ptr<cc::SolidColorDrawQuad> solidColorQuad = cc::SolidColorDrawQuad:: Create();
49 solidColorQuad->SetNew(sharedState.get(), rect, SK_ColorRED);
50 appendQuad(solidColorQuad.PassAs<DrawQuad>());
51
52 scoped_ptr<cc::StreamVideoDrawQuad> streamVideoQuad = cc::StreamVideoDrawQua d::Create();
53 streamVideoQuad->SetNew(sharedState.get(), rect, opaqueRect, 1, WebKit::WebT ransformationMatrix());
54 appendQuad(streamVideoQuad.PassAs<DrawQuad>());
55
56 scoped_ptr<cc::TextureDrawQuad> textureQuad = cc::TextureDrawQuad::Create();
57 textureQuad->SetNew(sharedState.get(), rect, opaqueRect, textureResource, fa lse, rect, false);
58 appendQuad(textureQuad.PassAs<DrawQuad>());
59
60 scoped_ptr<cc::TileDrawQuad> tileQuad = cc::TileDrawQuad::Create();
61 tileQuad->SetNew(sharedState.get(), rect, opaqueRect, textureResource, gfx:: RectF(0, 0, 100, 100), gfx::Size(100, 100), false, false, false, false, false);
62 appendQuad(tileQuad.PassAs<DrawQuad>());
44 63
45 cc::VideoLayerImpl::FramePlane planes[3]; 64 cc::VideoLayerImpl::FramePlane planes[3];
46 for (int i = 0; i < 3; ++i) { 65 for (int i = 0; i < 3; ++i) {
47 planes[i].resourceId = resourceProvider->createResourceFromExternalTextu re(1); 66 planes[i].resourceId = resourceProvider->createResourceFromExternalTextu re(1);
48 planes[i].size = gfx::Size(100, 100); 67 planes[i].size = gfx::Size(100, 100);
49 planes[i].format = GL_LUMINANCE; 68 planes[i].format = GL_LUMINANCE;
50 } 69 }
51 appendQuad(cc::YUVVideoDrawQuad::create(sharedState.get(), rect, opaqueRect, gfx::Size(100, 100), planes[0], planes[1], planes[2]).PassAs<DrawQuad>()); 70 scoped_ptr<cc::YUVVideoDrawQuad> yuvQuad = cc::YUVVideoDrawQuad::Create();
71 yuvQuad->SetNew(sharedState.get(), rect, opaqueRect, gfx::Size(100, 100), pl anes[0], planes[1], planes[2]);
72 appendQuad(yuvQuad.PassAs<DrawQuad>());
73
52 appendSharedQuadState(sharedState.Pass()); 74 appendSharedQuadState(sharedState.Pass());
53 } 75 }
54 76
55 } // namespace WebKitTests 77 } // namespace WebKitTests
OLDNEW
« no previous file with comments | « cc/stream_video_draw_quad.cc ('k') | cc/texture_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698