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

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

Issue 11275222: Avoid setting activeTexture redundantly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase for r166988 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/render_pass_test_common.h ('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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cc/test/render_pass_test_common.h"
6
7 #include "cc/checkerboard_draw_quad.h"
8 #include "cc/debug_border_draw_quad.h"
9 #include "cc/io_surface_draw_quad.h"
10 #include "cc/render_pass_draw_quad.h"
11 #include "cc/solid_color_draw_quad.h"
12 #include "cc/shared_quad_state.h"
13 #include "cc/stream_video_draw_quad.h"
14 #include "cc/texture_draw_quad.h"
15 #include "cc/tile_draw_quad.h"
16 #include "cc/yuv_video_draw_quad.h"
17 #include "cc/resource_provider.h"
18 #include <public/WebTransformationMatrix.h>
19
20 namespace WebKitTests {
21
22 using cc::DrawQuad;
23 using WebKit::WebTransformationMatrix;
24
25 void TestRenderPass::appendOneOfEveryQuadType(cc::ResourceProvider* resourceProv ider)
26 {
27 gfx::Rect rect(0, 0, 100, 100);
28 cc::ResourceProvider::ResourceId textureResource = resourceProvider->createR esourceFromExternalTexture(1);
29 scoped_ptr<cc::SharedQuadState> sharedState = cc::SharedQuadState::create(We bTransformationMatrix(), rect, rect, 1, false);
30
31 appendQuad(cc::CheckerboardDrawQuad::create(sharedState.get(), rect, SK_Colo rRED).PassAs<DrawQuad>());
32 appendQuad(cc::DebugBorderDrawQuad::create(sharedState.get(), rect, SK_Color RED, 1).Pass().PassAs<DrawQuad>());
33 appendQuad(cc::IOSurfaceDrawQuad::create(sharedState.get(), rect, gfx::Size( 50, 50), 1, cc::IOSurfaceDrawQuad::Flipped).PassAs<DrawQuad>());
34
35 cc::RenderPass::Id passId(1, 1);
36 appendQuad(cc::RenderPassDrawQuad::create(sharedState.get(), rect, passId, f alse, 0, rect, 0, 0, 0, 0).PassAs<DrawQuad>());
37
38 appendQuad(cc::SolidColorDrawQuad::create(sharedState.get(), rect, SK_ColorR ED).PassAs<DrawQuad>());
39 appendQuad(cc::StreamVideoDrawQuad::create(sharedState.get(), rect, 1, WebKi t::WebTransformationMatrix()).PassAs<DrawQuad>());
40 appendQuad(cc::TextureDrawQuad::create(sharedState.get(), rect, textureResou rce, false, rect, false).PassAs<DrawQuad>());
41
42 appendQuad(cc::TileDrawQuad::create(sharedState.get(), rect, rect, textureRe source, gfx::Vector2d(), gfx::Size(100, 100), GL_LINEAR, false, false, false, fa lse, false).PassAs<DrawQuad>());
43
44 cc::VideoLayerImpl::FramePlane planes[3];
45 for (int i = 0; i < 3; ++i) {
46 planes[i].resourceId = resourceProvider->createResourceFromExternalTextu re(1);
47 planes[i].size = gfx::Size(100, 100);
48 planes[i].format = GL_LUMINANCE;
49 }
50 appendQuad(cc::YUVVideoDrawQuad::create(sharedState.get(), rect, gfx::Size(1 00, 100), planes[0], planes[1], planes[2]).PassAs<DrawQuad>());
51 appendSharedQuadState(sharedState.Pass());
52 }
53
54 } // namespace WebKitTests
OLDNEW
« no previous file with comments | « cc/test/render_pass_test_common.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698