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

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

Issue 486853002: cc: Use a normal texture for background texture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits in unittests Created 6 years, 4 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/resources/video_resource_updater.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 16 matching lines...) Expand all
27 ResourceProvider* resource_provider, 27 ResourceProvider* resource_provider,
28 RenderPass::Id child_pass) { 28 RenderPass::Id child_pass) {
29 gfx::Rect rect(0, 0, 100, 100); 29 gfx::Rect rect(0, 0, 100, 100);
30 gfx::Rect opaque_rect(10, 10, 80, 80); 30 gfx::Rect opaque_rect(10, 10, 80, 80);
31 gfx::Rect visible_rect(0, 0, 100, 100); 31 gfx::Rect visible_rect(0, 0, 100, 100);
32 const float vertex_opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; 32 const float vertex_opacity[] = {1.0f, 1.0f, 1.0f, 1.0f};
33 33
34 ResourceProvider::ResourceId resource1 = resource_provider->CreateResource( 34 ResourceProvider::ResourceId resource1 = resource_provider->CreateResource(
35 gfx::Size(45, 5), 35 gfx::Size(45, 5),
36 GL_CLAMP_TO_EDGE, 36 GL_CLAMP_TO_EDGE,
37 ResourceProvider::TextureUsageAny, 37 ResourceProvider::TextureHintImmutable,
38 resource_provider->best_texture_format()); 38 resource_provider->best_texture_format());
39 resource_provider->AllocateForTesting(resource1); 39 resource_provider->AllocateForTesting(resource1);
40 ResourceProvider::ResourceId resource2 = resource_provider->CreateResource( 40 ResourceProvider::ResourceId resource2 = resource_provider->CreateResource(
41 gfx::Size(346, 61), 41 gfx::Size(346, 61),
42 GL_CLAMP_TO_EDGE, 42 GL_CLAMP_TO_EDGE,
43 ResourceProvider::TextureUsageAny, 43 ResourceProvider::TextureHintImmutable,
44 resource_provider->best_texture_format()); 44 resource_provider->best_texture_format());
45 resource_provider->AllocateForTesting(resource2); 45 resource_provider->AllocateForTesting(resource2);
46 ResourceProvider::ResourceId resource3 = resource_provider->CreateResource( 46 ResourceProvider::ResourceId resource3 = resource_provider->CreateResource(
47 gfx::Size(12, 134), 47 gfx::Size(12, 134),
48 GL_CLAMP_TO_EDGE, 48 GL_CLAMP_TO_EDGE,
49 ResourceProvider::TextureUsageAny, 49 ResourceProvider::TextureHintImmutable,
50 resource_provider->best_texture_format()); 50 resource_provider->best_texture_format());
51 resource_provider->AllocateForTesting(resource3); 51 resource_provider->AllocateForTesting(resource3);
52 ResourceProvider::ResourceId resource4 = resource_provider->CreateResource( 52 ResourceProvider::ResourceId resource4 = resource_provider->CreateResource(
53 gfx::Size(56, 12), 53 gfx::Size(56, 12),
54 GL_CLAMP_TO_EDGE, 54 GL_CLAMP_TO_EDGE,
55 ResourceProvider::TextureUsageAny, 55 ResourceProvider::TextureHintImmutable,
56 resource_provider->best_texture_format()); 56 resource_provider->best_texture_format());
57 resource_provider->AllocateForTesting(resource4); 57 resource_provider->AllocateForTesting(resource4);
58 ResourceProvider::ResourceId resource5 = resource_provider->CreateResource( 58 ResourceProvider::ResourceId resource5 = resource_provider->CreateResource(
59 gfx::Size(73, 26), 59 gfx::Size(73, 26),
60 GL_CLAMP_TO_EDGE, 60 GL_CLAMP_TO_EDGE,
61 ResourceProvider::TextureUsageAny, 61 ResourceProvider::TextureHintImmutable,
62 resource_provider->best_texture_format()); 62 resource_provider->best_texture_format());
63 resource_provider->AllocateForTesting(resource5); 63 resource_provider->AllocateForTesting(resource5);
64 ResourceProvider::ResourceId resource6 = resource_provider->CreateResource( 64 ResourceProvider::ResourceId resource6 = resource_provider->CreateResource(
65 gfx::Size(64, 92), 65 gfx::Size(64, 92),
66 GL_CLAMP_TO_EDGE, 66 GL_CLAMP_TO_EDGE,
67 ResourceProvider::TextureUsageAny, 67 ResourceProvider::TextureHintImmutable,
68 resource_provider->best_texture_format()); 68 resource_provider->best_texture_format());
69 resource_provider->AllocateForTesting(resource6); 69 resource_provider->AllocateForTesting(resource6);
70 ResourceProvider::ResourceId resource7 = resource_provider->CreateResource( 70 ResourceProvider::ResourceId resource7 = resource_provider->CreateResource(
71 gfx::Size(9, 14), 71 gfx::Size(9, 14),
72 GL_CLAMP_TO_EDGE, 72 GL_CLAMP_TO_EDGE,
73 ResourceProvider::TextureUsageAny, 73 ResourceProvider::TextureHintImmutable,
74 resource_provider->best_texture_format()); 74 resource_provider->best_texture_format());
75 resource_provider->AllocateForTesting(resource7); 75 resource_provider->AllocateForTesting(resource7);
76 76
77 unsigned target = GL_TEXTURE_2D; 77 unsigned target = GL_TEXTURE_2D;
78 gpu::Mailbox gpu_mailbox; 78 gpu::Mailbox gpu_mailbox;
79 memcpy(gpu_mailbox.name, "Hello world", strlen("Hello world") + 1); 79 memcpy(gpu_mailbox.name, "Hello world", strlen("Hello world") + 1);
80 scoped_ptr<SingleReleaseCallback> callback = 80 scoped_ptr<SingleReleaseCallback> callback =
81 SingleReleaseCallback::Create(base::Bind(&EmptyReleaseCallback)); 81 SingleReleaseCallback::Create(base::Bind(&EmptyReleaseCallback));
82 TextureMailbox mailbox(gpu_mailbox, target, kSyncPointForMailboxTextureQuad); 82 TextureMailbox mailbox(gpu_mailbox, target, kSyncPointForMailboxTextureQuad);
83 ResourceProvider::ResourceId resource8 = 83 ResourceProvider::ResourceId resource8 =
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 rect, 224 rect,
225 opaque_rect, 225 opaque_rect,
226 visible_rect, 226 visible_rect,
227 resource4, 227 resource4,
228 gfx::RectF(0, 0, 100, 100), 228 gfx::RectF(0, 0, 100, 100),
229 gfx::Size(100, 100), 229 gfx::Size(100, 100),
230 false); 230 false);
231 231
232 ResourceProvider::ResourceId plane_resources[4]; 232 ResourceProvider::ResourceId plane_resources[4];
233 for (int i = 0; i < 4; ++i) { 233 for (int i = 0; i < 4; ++i) {
234 plane_resources[i] = 234 plane_resources[i] = resource_provider->CreateResource(
235 resource_provider->CreateResource( 235 gfx::Size(20, 12),
236 gfx::Size(20, 12), 236 GL_CLAMP_TO_EDGE,
237 GL_CLAMP_TO_EDGE, 237 ResourceProvider::TextureHintImmutable,
238 ResourceProvider::TextureUsageAny, 238 resource_provider->best_texture_format());
239 resource_provider->best_texture_format());
240 resource_provider->AllocateForTesting(plane_resources[i]); 239 resource_provider->AllocateForTesting(plane_resources[i]);
241 } 240 }
242 YUVVideoDrawQuad::ColorSpace color_space = YUVVideoDrawQuad::REC_601; 241 YUVVideoDrawQuad::ColorSpace color_space = YUVVideoDrawQuad::REC_601;
243 YUVVideoDrawQuad* yuv_quad = 242 YUVVideoDrawQuad* yuv_quad =
244 this->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); 243 this->CreateAndAppendDrawQuad<YUVVideoDrawQuad>();
245 yuv_quad->SetNew(shared_state2, 244 yuv_quad->SetNew(shared_state2,
246 rect, 245 rect,
247 opaque_rect, 246 opaque_rect,
248 visible_rect, 247 visible_rect,
249 gfx::RectF(0, 0, 100, 100), 248 gfx::RectF(0, 0, 100, 100),
250 plane_resources[0], 249 plane_resources[0],
251 plane_resources[1], 250 plane_resources[1],
252 plane_resources[2], 251 plane_resources[2],
253 plane_resources[3], 252 plane_resources[3],
254 color_space); 253 color_space);
255 } 254 }
256 255
257 } // namespace cc 256 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/video_resource_updater.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