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

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

Issue 11416088: cc: Turn SharedQuadState into a struct-like class similar to DrawQuads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix debug build 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/test/mock_quad_culler.cc ('k') | no next file » | 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"
11 #include "cc/solid_color_draw_quad.h" 11 #include "cc/solid_color_draw_quad.h"
12 #include "cc/shared_quad_state.h" 12 #include "cc/shared_quad_state.h"
13 #include "cc/stream_video_draw_quad.h" 13 #include "cc/stream_video_draw_quad.h"
14 #include "cc/texture_draw_quad.h" 14 #include "cc/texture_draw_quad.h"
15 #include "cc/tile_draw_quad.h" 15 #include "cc/tile_draw_quad.h"
16 #include "cc/yuv_video_draw_quad.h" 16 #include "cc/yuv_video_draw_quad.h"
17 #include "cc/resource_provider.h" 17 #include "cc/resource_provider.h"
18 #include <public/WebTransformationMatrix.h> 18 #include <public/WebTransformationMatrix.h>
19 19
20 namespace WebKitTests { 20 namespace WebKitTests {
21 21
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();
31 sharedState->SetAll(WebTransformationMatrix(), rect, rect, 1);
31 32
32 scoped_ptr<cc::CheckerboardDrawQuad> checkerboardQuad = cc::CheckerboardDraw Quad::Create(); 33 scoped_ptr<cc::CheckerboardDrawQuad> checkerboardQuad = cc::CheckerboardDraw Quad::Create();
33 checkerboardQuad->SetNew(sharedState.get(), rect, SK_ColorRED); 34 checkerboardQuad->SetNew(sharedState.get(), rect, SK_ColorRED);
34 appendQuad(checkerboardQuad.PassAs<DrawQuad>()); 35 appendQuad(checkerboardQuad.PassAs<DrawQuad>());
35 36
36 scoped_ptr<cc::DebugBorderDrawQuad> debugBorderQuad = cc::DebugBorderDrawQua d::Create(); 37 scoped_ptr<cc::DebugBorderDrawQuad> debugBorderQuad = cc::DebugBorderDrawQua d::Create();
37 debugBorderQuad->SetNew(sharedState.get(), rect, SK_ColorRED, 1); 38 debugBorderQuad->SetNew(sharedState.get(), rect, SK_ColorRED, 1);
38 appendQuad(debugBorderQuad.PassAs<DrawQuad>()); 39 appendQuad(debugBorderQuad.PassAs<DrawQuad>());
39 40
40 scoped_ptr<cc::IOSurfaceDrawQuad> ioSurfaceQuad = cc::IOSurfaceDrawQuad::Cre ate(); 41 scoped_ptr<cc::IOSurfaceDrawQuad> ioSurfaceQuad = cc::IOSurfaceDrawQuad::Cre ate();
(...skipping 27 matching lines...) Expand all
68 planes[i].format = GL_LUMINANCE; 69 planes[i].format = GL_LUMINANCE;
69 } 70 }
70 scoped_ptr<cc::YUVVideoDrawQuad> yuvQuad = cc::YUVVideoDrawQuad::Create(); 71 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 yuvQuad->SetNew(sharedState.get(), rect, opaqueRect, gfx::Size(100, 100), pl anes[0], planes[1], planes[2]);
72 appendQuad(yuvQuad.PassAs<DrawQuad>()); 73 appendQuad(yuvQuad.PassAs<DrawQuad>());
73 74
74 appendSharedQuadState(sharedState.Pass()); 75 appendSharedQuadState(sharedState.Pass());
75 } 76 }
76 77
77 } // namespace WebKitTests 78 } // namespace WebKitTests
OLDNEW
« no previous file with comments | « cc/test/mock_quad_culler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698