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_utils.h" | 5 #include "cc/test/render_pass_test_utils.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "cc/quads/debug_border_draw_quad.h" | 8 #include "cc/quads/debug_border_draw_quad.h" |
9 #include "cc/quads/io_surface_draw_quad.h" | 9 #include "cc/quads/io_surface_draw_quad.h" |
10 #include "cc/quads/render_pass_draw_quad.h" | 10 #include "cc/quads/render_pass_draw_quad.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 contributing_pass->id, | 137 contributing_pass->id, |
138 mask_resource_id, | 138 mask_resource_id, |
139 gfx::Vector2dF(1.f, 1.f), | 139 gfx::Vector2dF(1.f, 1.f), |
140 arbitrary_nonzero_size, | 140 arbitrary_nonzero_size, |
141 filters, | 141 filters, |
142 gfx::Vector2dF(), | 142 gfx::Vector2dF(), |
143 FilterOperations()); | 143 FilterOperations()); |
144 } | 144 } |
145 | 145 |
146 static void EmptyReleaseCallback(uint32 sync_point, | 146 static void EmptyReleaseCallback(uint32 sync_point, |
| 147 const gpu::SyncToken& sync_token, |
147 bool lost_resource, | 148 bool lost_resource, |
148 BlockingTaskRunner* main_thread_task_runner) {} | 149 BlockingTaskRunner* main_thread_task_runner) {} |
149 | 150 |
150 void AddOneOfEveryQuadType(RenderPass* to_pass, | 151 void AddOneOfEveryQuadType(RenderPass* to_pass, |
151 ResourceProvider* resource_provider, | 152 ResourceProvider* resource_provider, |
152 RenderPassId child_pass, | 153 RenderPassId child_pass, |
153 uint32_t* sync_point_for_mailbox_texture_quad) { | 154 uint32_t* sync_point_for_mailbox_texture_quad) { |
154 gfx::Rect rect(0, 0, 100, 100); | 155 gfx::Rect rect(0, 0, 100, 100); |
155 gfx::Rect opaque_rect(10, 10, 80, 80); | 156 gfx::Rect opaque_rect(10, 10, 80, 80); |
156 gfx::Rect visible_rect(0, 0, 100, 100); | 157 gfx::Rect visible_rect(0, 0, 100, 100); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 gfx::Size(9, 14), ResourceProvider::TEXTURE_HINT_IMMUTABLE, | 189 gfx::Size(9, 14), ResourceProvider::TEXTURE_HINT_IMMUTABLE, |
189 resource_provider->best_texture_format()); | 190 resource_provider->best_texture_format()); |
190 resource_provider->AllocateForTesting(resource7); | 191 resource_provider->AllocateForTesting(resource7); |
191 | 192 |
192 unsigned target = GL_TEXTURE_2D; | 193 unsigned target = GL_TEXTURE_2D; |
193 gpu::Mailbox gpu_mailbox; | 194 gpu::Mailbox gpu_mailbox; |
194 memcpy(gpu_mailbox.name, "Hello world", strlen("Hello world") + 1); | 195 memcpy(gpu_mailbox.name, "Hello world", strlen("Hello world") + 1); |
195 scoped_ptr<SingleReleaseCallbackImpl> callback = | 196 scoped_ptr<SingleReleaseCallbackImpl> callback = |
196 SingleReleaseCallbackImpl::Create(base::Bind(&EmptyReleaseCallback)); | 197 SingleReleaseCallbackImpl::Create(base::Bind(&EmptyReleaseCallback)); |
197 TextureMailbox mailbox(gpu_mailbox, target, | 198 TextureMailbox mailbox(gpu_mailbox, target, |
198 *sync_point_for_mailbox_texture_quad); | 199 *sync_point_for_mailbox_texture_quad, |
| 200 gpu::SyncToken()); |
199 ResourceId resource8 = resource_provider->CreateResourceFromTextureMailbox( | 201 ResourceId resource8 = resource_provider->CreateResourceFromTextureMailbox( |
200 mailbox, callback.Pass()); | 202 mailbox, callback.Pass()); |
201 resource_provider->AllocateForTesting(resource8); | 203 resource_provider->AllocateForTesting(resource8); |
202 | 204 |
203 SharedQuadState* shared_state = to_pass->CreateAndAppendSharedQuadState(); | 205 SharedQuadState* shared_state = to_pass->CreateAndAppendSharedQuadState(); |
204 shared_state->SetAll(gfx::Transform(), rect.size(), rect, rect, false, 1, | 206 shared_state->SetAll(gfx::Transform(), rect.size(), rect, rect, false, 1, |
205 SkXfermode::kSrcOver_Mode, 0); | 207 SkXfermode::kSrcOver_Mode, 0); |
206 | 208 |
207 DebugBorderDrawQuad* debug_border_quad = | 209 DebugBorderDrawQuad* debug_border_quad = |
208 to_pass->CreateAndAppendDrawQuad<DebugBorderDrawQuad>(); | 210 to_pass->CreateAndAppendDrawQuad<DebugBorderDrawQuad>(); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 YUVVideoDrawQuad* yuv_quad = | 294 YUVVideoDrawQuad* yuv_quad = |
293 to_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); | 295 to_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); |
294 yuv_quad->SetNew(shared_state2, rect, opaque_rect, visible_rect, | 296 yuv_quad->SetNew(shared_state2, rect, opaque_rect, visible_rect, |
295 gfx::RectF(.0f, .0f, 100.0f, 100.0f), | 297 gfx::RectF(.0f, .0f, 100.0f, 100.0f), |
296 gfx::RectF(.0f, .0f, 50.0f, 50.0f), gfx::Size(100, 100), | 298 gfx::RectF(.0f, .0f, 50.0f, 50.0f), gfx::Size(100, 100), |
297 gfx::Size(50, 50), plane_resources[0], plane_resources[1], | 299 gfx::Size(50, 50), plane_resources[0], plane_resources[1], |
298 plane_resources[2], plane_resources[3], color_space); | 300 plane_resources[2], plane_resources[3], color_space); |
299 } | 301 } |
300 | 302 |
301 } // namespace cc | 303 } // namespace cc |
OLD | NEW |