OLD | NEW |
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" |
11 #include "cc/quads/render_pass_draw_quad.h" | 11 #include "cc/quads/render_pass_draw_quad.h" |
12 #include "cc/quads/shared_quad_state.h" | 12 #include "cc/quads/shared_quad_state.h" |
13 #include "cc/quads/solid_color_draw_quad.h" | 13 #include "cc/quads/solid_color_draw_quad.h" |
14 #include "cc/quads/stream_video_draw_quad.h" | 14 #include "cc/quads/stream_video_draw_quad.h" |
15 #include "cc/quads/texture_draw_quad.h" | 15 #include "cc/quads/texture_draw_quad.h" |
16 #include "cc/quads/tile_draw_quad.h" | 16 #include "cc/quads/tile_draw_quad.h" |
17 #include "cc/quads/yuv_video_draw_quad.h" | 17 #include "cc/quads/yuv_video_draw_quad.h" |
18 #include "cc/resources/resource_provider.h" | 18 #include "cc/resources/resource_provider.h" |
| 19 #include "cc/trees/blocking_task_runner.h" |
19 #include "ui/gfx/transform.h" | 20 #include "ui/gfx/transform.h" |
20 | 21 |
21 namespace cc { | 22 namespace cc { |
22 | 23 |
23 static void EmptyReleaseCallback(uint32 sync_point, bool lost_resource) { | 24 static void EmptyReleaseCallback(uint32 sync_point, |
| 25 bool lost_resource, |
| 26 BlockingTaskRunner* main_thread_task_runner) { |
24 } | 27 } |
25 | 28 |
26 void TestRenderPass::AppendOneOfEveryQuadType( | 29 void TestRenderPass::AppendOneOfEveryQuadType( |
27 ResourceProvider* resource_provider, | 30 ResourceProvider* resource_provider, |
28 RenderPassId child_pass) { | 31 RenderPassId child_pass) { |
29 gfx::Rect rect(0, 0, 100, 100); | 32 gfx::Rect rect(0, 0, 100, 100); |
30 gfx::Rect opaque_rect(10, 10, 80, 80); | 33 gfx::Rect opaque_rect(10, 10, 80, 80); |
31 gfx::Rect visible_rect(0, 0, 100, 100); | 34 gfx::Rect visible_rect(0, 0, 100, 100); |
32 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}; |
33 | 36 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 ResourceProvider::ResourceId resource7 = resource_provider->CreateResource( | 73 ResourceProvider::ResourceId resource7 = resource_provider->CreateResource( |
71 gfx::Size(9, 14), | 74 gfx::Size(9, 14), |
72 GL_CLAMP_TO_EDGE, | 75 GL_CLAMP_TO_EDGE, |
73 ResourceProvider::TextureHintImmutable, | 76 ResourceProvider::TextureHintImmutable, |
74 resource_provider->best_texture_format()); | 77 resource_provider->best_texture_format()); |
75 resource_provider->AllocateForTesting(resource7); | 78 resource_provider->AllocateForTesting(resource7); |
76 | 79 |
77 unsigned target = GL_TEXTURE_2D; | 80 unsigned target = GL_TEXTURE_2D; |
78 gpu::Mailbox gpu_mailbox; | 81 gpu::Mailbox gpu_mailbox; |
79 memcpy(gpu_mailbox.name, "Hello world", strlen("Hello world") + 1); | 82 memcpy(gpu_mailbox.name, "Hello world", strlen("Hello world") + 1); |
80 scoped_ptr<SingleReleaseCallback> callback = | 83 scoped_ptr<SingleReleaseCallbackImpl> callback = |
81 SingleReleaseCallback::Create(base::Bind(&EmptyReleaseCallback)); | 84 SingleReleaseCallbackImpl::Create(base::Bind(&EmptyReleaseCallback)); |
82 TextureMailbox mailbox(gpu_mailbox, target, kSyncPointForMailboxTextureQuad); | 85 TextureMailbox mailbox(gpu_mailbox, target, kSyncPointForMailboxTextureQuad); |
83 ResourceProvider::ResourceId resource8 = | 86 ResourceProvider::ResourceId resource8 = |
84 resource_provider->CreateResourceFromTextureMailbox(mailbox, | 87 resource_provider->CreateResourceFromTextureMailbox(mailbox, |
85 callback.Pass()); | 88 callback.Pass()); |
86 resource_provider->AllocateForTesting(resource8); | 89 resource_provider->AllocateForTesting(resource8); |
87 | 90 |
88 SharedQuadState* shared_state = this->CreateAndAppendSharedQuadState(); | 91 SharedQuadState* shared_state = this->CreateAndAppendSharedQuadState(); |
89 shared_state->SetAll(gfx::Transform(), | 92 shared_state->SetAll(gfx::Transform(), |
90 rect.size(), | 93 rect.size(), |
91 rect, | 94 rect, |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 visible_rect, | 250 visible_rect, |
248 gfx::RectF(0, 0, 100, 100), | 251 gfx::RectF(0, 0, 100, 100), |
249 plane_resources[0], | 252 plane_resources[0], |
250 plane_resources[1], | 253 plane_resources[1], |
251 plane_resources[2], | 254 plane_resources[2], |
252 plane_resources[3], | 255 plane_resources[3], |
253 color_space); | 256 color_space); |
254 } | 257 } |
255 | 258 |
256 } // namespace cc | 259 } // namespace cc |
OLD | NEW |