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

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

Issue 952893003: Update from https://crrev.com/317530 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix gn for nacl Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « cc/test/layer_tree_test.cc ('k') | cc/test/test_web_graphics_context_3d.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 "base/bind.h" 7 #include "base/bind.h"
8 #include "cc/quads/checkerboard_draw_quad.h" 8 #include "cc/quads/checkerboard_draw_quad.h"
9 #include "cc/quads/debug_border_draw_quad.h" 9 #include "cc/quads/debug_border_draw_quad.h"
10 #include "cc/quads/io_surface_draw_quad.h" 10 #include "cc/quads/io_surface_draw_quad.h"
(...skipping 17 matching lines...) Expand all
28 28
29 void TestRenderPass::AppendOneOfEveryQuadType( 29 void TestRenderPass::AppendOneOfEveryQuadType(
30 ResourceProvider* resource_provider, 30 ResourceProvider* resource_provider,
31 RenderPassId child_pass) { 31 RenderPassId child_pass) {
32 gfx::Rect rect(0, 0, 100, 100); 32 gfx::Rect rect(0, 0, 100, 100);
33 gfx::Rect opaque_rect(10, 10, 80, 80); 33 gfx::Rect opaque_rect(10, 10, 80, 80);
34 gfx::Rect visible_rect(0, 0, 100, 100); 34 gfx::Rect visible_rect(0, 0, 100, 100);
35 const float vertex_opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; 35 const float vertex_opacity[] = {1.0f, 1.0f, 1.0f, 1.0f};
36 36
37 ResourceProvider::ResourceId resource1 = resource_provider->CreateResource( 37 ResourceProvider::ResourceId resource1 = resource_provider->CreateResource(
38 gfx::Size(45, 5), 38 gfx::Size(45, 5), GL_CLAMP_TO_EDGE,
39 GL_CLAMP_TO_EDGE, 39 ResourceProvider::TEXTURE_HINT_IMMUTABLE,
40 ResourceProvider::TextureHintImmutable,
41 resource_provider->best_texture_format()); 40 resource_provider->best_texture_format());
42 resource_provider->AllocateForTesting(resource1); 41 resource_provider->AllocateForTesting(resource1);
43 ResourceProvider::ResourceId resource2 = resource_provider->CreateResource( 42 ResourceProvider::ResourceId resource2 = resource_provider->CreateResource(
44 gfx::Size(346, 61), 43 gfx::Size(346, 61), GL_CLAMP_TO_EDGE,
45 GL_CLAMP_TO_EDGE, 44 ResourceProvider::TEXTURE_HINT_IMMUTABLE,
46 ResourceProvider::TextureHintImmutable,
47 resource_provider->best_texture_format()); 45 resource_provider->best_texture_format());
48 resource_provider->AllocateForTesting(resource2); 46 resource_provider->AllocateForTesting(resource2);
49 ResourceProvider::ResourceId resource3 = resource_provider->CreateResource( 47 ResourceProvider::ResourceId resource3 = resource_provider->CreateResource(
50 gfx::Size(12, 134), 48 gfx::Size(12, 134), GL_CLAMP_TO_EDGE,
51 GL_CLAMP_TO_EDGE, 49 ResourceProvider::TEXTURE_HINT_IMMUTABLE,
52 ResourceProvider::TextureHintImmutable,
53 resource_provider->best_texture_format()); 50 resource_provider->best_texture_format());
54 resource_provider->AllocateForTesting(resource3); 51 resource_provider->AllocateForTesting(resource3);
55 ResourceProvider::ResourceId resource4 = resource_provider->CreateResource( 52 ResourceProvider::ResourceId resource4 = resource_provider->CreateResource(
56 gfx::Size(56, 12), 53 gfx::Size(56, 12), GL_CLAMP_TO_EDGE,
57 GL_CLAMP_TO_EDGE, 54 ResourceProvider::TEXTURE_HINT_IMMUTABLE,
58 ResourceProvider::TextureHintImmutable,
59 resource_provider->best_texture_format()); 55 resource_provider->best_texture_format());
60 resource_provider->AllocateForTesting(resource4); 56 resource_provider->AllocateForTesting(resource4);
61 gfx::Size resource5_size(73, 26); 57 gfx::Size resource5_size(73, 26);
62 ResourceProvider::ResourceId resource5 = resource_provider->CreateResource( 58 ResourceProvider::ResourceId resource5 = resource_provider->CreateResource(
63 resource5_size, 59 resource5_size, GL_CLAMP_TO_EDGE,
64 GL_CLAMP_TO_EDGE, 60 ResourceProvider::TEXTURE_HINT_IMMUTABLE,
65 ResourceProvider::TextureHintImmutable,
66 resource_provider->best_texture_format()); 61 resource_provider->best_texture_format());
67 resource_provider->AllocateForTesting(resource5); 62 resource_provider->AllocateForTesting(resource5);
68 ResourceProvider::ResourceId resource6 = resource_provider->CreateResource( 63 ResourceProvider::ResourceId resource6 = resource_provider->CreateResource(
69 gfx::Size(64, 92), 64 gfx::Size(64, 92), GL_CLAMP_TO_EDGE,
70 GL_CLAMP_TO_EDGE, 65 ResourceProvider::TEXTURE_HINT_IMMUTABLE,
71 ResourceProvider::TextureHintImmutable,
72 resource_provider->best_texture_format()); 66 resource_provider->best_texture_format());
73 resource_provider->AllocateForTesting(resource6); 67 resource_provider->AllocateForTesting(resource6);
74 ResourceProvider::ResourceId resource7 = resource_provider->CreateResource( 68 ResourceProvider::ResourceId resource7 = resource_provider->CreateResource(
75 gfx::Size(9, 14), 69 gfx::Size(9, 14), GL_CLAMP_TO_EDGE,
76 GL_CLAMP_TO_EDGE, 70 ResourceProvider::TEXTURE_HINT_IMMUTABLE,
77 ResourceProvider::TextureHintImmutable,
78 resource_provider->best_texture_format()); 71 resource_provider->best_texture_format());
79 resource_provider->AllocateForTesting(resource7); 72 resource_provider->AllocateForTesting(resource7);
80 73
81 unsigned target = GL_TEXTURE_2D; 74 unsigned target = GL_TEXTURE_2D;
82 gpu::Mailbox gpu_mailbox; 75 gpu::Mailbox gpu_mailbox;
83 memcpy(gpu_mailbox.name, "Hello world", strlen("Hello world") + 1); 76 memcpy(gpu_mailbox.name, "Hello world", strlen("Hello world") + 1);
84 scoped_ptr<SingleReleaseCallbackImpl> callback = 77 scoped_ptr<SingleReleaseCallbackImpl> callback =
85 SingleReleaseCallbackImpl::Create(base::Bind(&EmptyReleaseCallback)); 78 SingleReleaseCallbackImpl::Create(base::Bind(&EmptyReleaseCallback));
86 TextureMailbox mailbox(gpu_mailbox, target, kSyncPointForMailboxTextureQuad); 79 TextureMailbox mailbox(gpu_mailbox, target, kSyncPointForMailboxTextureQuad);
87 ResourceProvider::ResourceId resource8 = 80 ResourceProvider::ResourceId resource8 =
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 visible_rect, 229 visible_rect,
237 resource4, 230 resource4,
238 gfx::RectF(0, 0, 100, 100), 231 gfx::RectF(0, 0, 100, 100),
239 gfx::Size(100, 100), 232 gfx::Size(100, 100),
240 false, 233 false,
241 false); 234 false);
242 235
243 ResourceProvider::ResourceId plane_resources[4]; 236 ResourceProvider::ResourceId plane_resources[4];
244 for (int i = 0; i < 4; ++i) { 237 for (int i = 0; i < 4; ++i) {
245 plane_resources[i] = resource_provider->CreateResource( 238 plane_resources[i] = resource_provider->CreateResource(
246 gfx::Size(20, 12), 239 gfx::Size(20, 12), GL_CLAMP_TO_EDGE,
247 GL_CLAMP_TO_EDGE, 240 ResourceProvider::TEXTURE_HINT_IMMUTABLE,
248 ResourceProvider::TextureHintImmutable,
249 resource_provider->best_texture_format()); 241 resource_provider->best_texture_format());
250 resource_provider->AllocateForTesting(plane_resources[i]); 242 resource_provider->AllocateForTesting(plane_resources[i]);
251 } 243 }
252 YUVVideoDrawQuad::ColorSpace color_space = YUVVideoDrawQuad::REC_601; 244 YUVVideoDrawQuad::ColorSpace color_space = YUVVideoDrawQuad::REC_601;
253 YUVVideoDrawQuad* yuv_quad = 245 YUVVideoDrawQuad* yuv_quad =
254 this->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); 246 this->CreateAndAppendDrawQuad<YUVVideoDrawQuad>();
255 yuv_quad->SetNew(shared_state2, rect, opaque_rect, visible_rect, 247 yuv_quad->SetNew(shared_state2, rect, opaque_rect, visible_rect,
256 gfx::RectF(0, 0, 100, 100), gfx::Size(100, 100), 248 gfx::RectF(0, 0, 100, 100), gfx::Size(100, 100),
257 plane_resources[0], plane_resources[1], plane_resources[2], 249 plane_resources[0], plane_resources[1], plane_resources[2],
258 plane_resources[3], color_space); 250 plane_resources[3], color_space);
259 } 251 }
260 252
261 } // namespace cc 253 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_tree_test.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