OLD | NEW |
1 diff --git a/cc/BUILD.gn b/cc/BUILD.gn | 1 diff --git a/cc/BUILD.gn b/cc/BUILD.gn |
2 index 9c4752d..e217b12 100644 | 2 index 0411b45..4ee07db 100644 |
3 --- a/cc/BUILD.gn | 3 --- a/cc/BUILD.gn |
4 +++ b/cc/BUILD.gn | 4 +++ b/cc/BUILD.gn |
5 @@ -222,13 +222,6 @@ component("cc") { | 5 @@ -222,13 +222,6 @@ component("cc") { |
6 "layers/ui_resource_layer.h", | 6 "layers/ui_resource_layer.h", |
7 "layers/ui_resource_layer_impl.cc", | 7 "layers/ui_resource_layer_impl.cc", |
8 "layers/ui_resource_layer_impl.h", | 8 "layers/ui_resource_layer_impl.h", |
9 - "layers/video_frame_provider.h", | 9 - "layers/video_frame_provider.h", |
10 - "layers/video_frame_provider_client_impl.cc", | 10 - "layers/video_frame_provider_client_impl.cc", |
11 - "layers/video_frame_provider_client_impl.h", | 11 - "layers/video_frame_provider_client_impl.h", |
12 - "layers/video_layer.cc", | 12 - "layers/video_layer.cc", |
13 - "layers/video_layer.h", | 13 - "layers/video_layer.h", |
14 - "layers/video_layer_impl.cc", | 14 - "layers/video_layer_impl.cc", |
15 - "layers/video_layer_impl.h", | 15 - "layers/video_layer_impl.h", |
16 "output/begin_frame_args.cc", | 16 "output/begin_frame_args.cc", |
17 "output/begin_frame_args.h", | 17 "output/begin_frame_args.h", |
18 "output/bsp_tree.cc", | 18 "output/bsp_tree.cc", |
19 @@ -480,8 +473,6 @@ component("cc") { | 19 @@ -486,8 +479,6 @@ component("cc") { |
20 "resources/ui_resource_client.h", | 20 "resources/ui_resource_client.h", |
21 "resources/ui_resource_request.cc", | 21 "resources/ui_resource_request.cc", |
22 "resources/ui_resource_request.h", | 22 "resources/ui_resource_request.h", |
23 - "resources/video_resource_updater.cc", | 23 - "resources/video_resource_updater.cc", |
24 - "resources/video_resource_updater.h", | 24 - "resources/video_resource_updater.h", |
25 "resources/zero_copy_tile_task_worker_pool.cc", | 25 "resources/zero_copy_tile_task_worker_pool.cc", |
26 "resources/zero_copy_tile_task_worker_pool.h", | 26 "resources/zero_copy_tile_task_worker_pool.h", |
27 "scheduler/begin_frame_source.cc", | 27 "scheduler/begin_frame_source.cc", |
28 @@ -623,8 +614,6 @@ source_set("test_support") { | 28 @@ -628,8 +619,6 @@ source_set("test_support") { |
29 "test/fake_tile_manager_client.h", | 29 "test/fake_tile_manager_client.h", |
30 "test/fake_ui_resource_layer_tree_host_impl.cc", | 30 "test/fake_ui_resource_layer_tree_host_impl.cc", |
31 "test/fake_ui_resource_layer_tree_host_impl.h", | 31 "test/fake_ui_resource_layer_tree_host_impl.h", |
32 - "test/fake_video_frame_provider.cc", | 32 - "test/fake_video_frame_provider.cc", |
33 - "test/fake_video_frame_provider.h", | 33 - "test/fake_video_frame_provider.h", |
34 "test/geometry_test_utils.cc", | 34 "test/geometry_test_utils.cc", |
35 "test/geometry_test_utils.h", | 35 "test/geometry_test_utils.h", |
36 "test/impl_side_painting_settings.h", | 36 "test/impl_side_painting_settings.h", |
37 @@ -782,7 +771,6 @@ test("cc_unittests") { | 37 @@ -787,7 +776,6 @@ test("cc_unittests") { |
38 "layers/tiled_layer_unittest.cc", | 38 "layers/tiled_layer_unittest.cc", |
39 "layers/ui_resource_layer_impl_unittest.cc", | 39 "layers/ui_resource_layer_impl_unittest.cc", |
40 "layers/ui_resource_layer_unittest.cc", | 40 "layers/ui_resource_layer_unittest.cc", |
41 - "layers/video_layer_impl_unittest.cc", | 41 - "layers/video_layer_impl_unittest.cc", |
42 "output/begin_frame_args_unittest.cc", | 42 "output/begin_frame_args_unittest.cc", |
43 "output/delegating_renderer_unittest.cc", | 43 "output/delegating_renderer_unittest.cc", |
44 "output/filter_operations_unittest.cc", | 44 "output/filter_operations_unittest.cc", |
45 @@ -843,7 +831,6 @@ test("cc_unittests") { | 45 @@ -848,7 +836,6 @@ test("cc_unittests") { |
46 "trees/layer_tree_host_unittest_picture.cc", | 46 "trees/layer_tree_host_unittest_picture.cc", |
47 "trees/layer_tree_host_unittest_proxy.cc", | 47 "trees/layer_tree_host_unittest_proxy.cc", |
48 "trees/layer_tree_host_unittest_scroll.cc", | 48 "trees/layer_tree_host_unittest_scroll.cc", |
49 - "trees/layer_tree_host_unittest_video.cc", | 49 - "trees/layer_tree_host_unittest_video.cc", |
50 "trees/layer_tree_impl_unittest.cc", | 50 "trees/layer_tree_impl_unittest.cc", |
51 "trees/occlusion_tracker_unittest.cc", | 51 "trees/occlusion_tracker_unittest.cc", |
52 "trees/occlusion_unittest.cc", | 52 "trees/occlusion_unittest.cc", |
53 diff --git a/cc/layers/video_frame_provider.h b/cc/layers/video_frame_provider.h | 53 diff --git a/cc/layers/video_frame_provider.h b/cc/layers/video_frame_provider.h |
54 deleted file mode 100644 | 54 deleted file mode 100644 |
55 index 784d951..0000000 | 55 index 784d951..0000000 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 - matrix[0], matrix[4], matrix[8], matrix[12], | 235 - matrix[0], matrix[4], matrix[8], matrix[12], |
236 - matrix[1], matrix[5], matrix[9], matrix[13], | 236 - matrix[1], matrix[5], matrix[9], matrix[13], |
237 - matrix[2], matrix[6], matrix[10], matrix[14], | 237 - matrix[2], matrix[6], matrix[10], matrix[14], |
238 - matrix[3], matrix[7], matrix[11], matrix[15]); | 238 - matrix[3], matrix[7], matrix[11], matrix[15]); |
239 - if (active_video_layer_) | 239 - if (active_video_layer_) |
240 - active_video_layer_->SetNeedsRedraw(); | 240 - active_video_layer_->SetNeedsRedraw(); |
241 -} | 241 -} |
242 - | 242 - |
243 -} // namespace cc | 243 -} // namespace cc |
244 diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc | 244 diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc |
245 index 2016447..578faa9 100644 | 245 index 613ea4b..3813e1d 100644 |
246 --- a/cc/output/gl_renderer.cc | 246 --- a/cc/output/gl_renderer.cc |
247 +++ b/cc/output/gl_renderer.cc | 247 +++ b/cc/output/gl_renderer.cc |
248 @@ -13,7 +13,6 @@ | 248 @@ -18,7 +18,6 @@ |
249 #include "base/logging.h" | 249 #include "build/build_config.h" |
250 #include "base/trace_event/trace_event.h" | 250 #include "base/trace_event/trace_event.h" |
251 #include "cc/base/math_util.h" | 251 #include "cc/base/math_util.h" |
252 -#include "cc/layers/video_layer_impl.h" | 252 -#include "cc/layers/video_layer_impl.h" |
253 #include "cc/output/compositor_frame.h" | 253 #include "cc/output/compositor_frame.h" |
254 #include "cc/output/compositor_frame_metadata.h" | 254 #include "cc/output/compositor_frame_metadata.h" |
255 #include "cc/output/context_provider.h" | 255 #include "cc/output/context_provider.h" |
256 diff --git a/cc/output/renderer_pixeltest.cc b/cc/output/renderer_pixeltest.cc | 256 diff --git a/cc/output/renderer_pixeltest.cc b/cc/output/renderer_pixeltest.cc |
257 index b30b0a5..81ad842 100644 | 257 index 295fc84..ebda8d6 100644 |
258 --- a/cc/output/renderer_pixeltest.cc | 258 --- a/cc/output/renderer_pixeltest.cc |
259 +++ b/cc/output/renderer_pixeltest.cc | 259 +++ b/cc/output/renderer_pixeltest.cc |
260 @@ -12,7 +12,6 @@ | 260 @@ -12,7 +12,6 @@ |
261 #include "cc/test/fake_picture_pile_impl.h" | 261 #include "cc/test/fake_picture_pile_impl.h" |
262 #include "cc/test/pixel_test.h" | 262 #include "cc/test/pixel_test.h" |
263 #include "gpu/command_buffer/client/gles2_interface.h" | 263 #include "gpu/command_buffer/client/gles2_interface.h" |
264 -#include "media/base/video_frame.h" | 264 -#include "media/base/video_frame.h" |
265 #include "third_party/skia/include/core/SkColorPriv.h" | 265 #include "third_party/skia/include/core/SkColorPriv.h" |
266 #include "third_party/skia/include/core/SkImageFilter.h" | 266 #include "third_party/skia/include/core/SkImageFilter.h" |
267 #include "third_party/skia/include/core/SkMatrix.h" | 267 #include "third_party/skia/include/core/SkMatrix.h" |
268 @@ -388,453 +387,6 @@ TEST_F(GLRendererPixelTest, NonPremultipliedTextureWithBac
kground) { | 268 @@ -902,243 +901,6 @@ TEST_F(GLRendererPixelTest, NonPremultipliedTextureWithBac
kground) { |
269 FuzzyPixelOffByOneComparator(true))); | 269 FuzzyPixelOffByOneComparator(true))); |
270 } | 270 } |
271 | 271 |
272 -class VideoGLRendererPixelTest : public GLRendererPixelTest { | 272 -class VideoGLRendererPixelTest : public GLRendererPixelTest { |
273 - protected: | 273 - protected: |
274 - void CreateTestYUVVideoDrawQuad_Striped(const SharedQuadState* shared_state, | |
275 - media::VideoFrame::Format format, | |
276 - bool is_transparent, | |
277 - const gfx::RectF& tex_coord_rect, | |
278 - RenderPass* render_pass) { | |
279 - const gfx::Rect rect(this->device_viewport_size_); | |
280 - | |
281 - scoped_refptr<media::VideoFrame> video_frame = | |
282 - media::VideoFrame::CreateFrame( | |
283 - format, rect.size(), rect, rect.size(), base::TimeDelta()); | |
284 - | |
285 - // YUV values representing a striped pattern, for validating texture | |
286 - // coordinates for sampling. | |
287 - uint8_t y_value = 0; | |
288 - uint8_t u_value = 0; | |
289 - uint8_t v_value = 0; | |
290 - for (int i = 0; i < video_frame->rows(media::VideoFrame::kYPlane); ++i) { | |
291 - uint8_t* y_row = video_frame->data(media::VideoFrame::kYPlane) + | |
292 - video_frame->stride(media::VideoFrame::kYPlane) * i; | |
293 - for (int j = 0; j < video_frame->row_bytes(media::VideoFrame::kYPlane); | |
294 - ++j) { | |
295 - y_row[j] = (y_value += 1); | |
296 - } | |
297 - } | |
298 - for (int i = 0; i < video_frame->rows(media::VideoFrame::kUPlane); ++i) { | |
299 - uint8_t* u_row = video_frame->data(media::VideoFrame::kUPlane) + | |
300 - video_frame->stride(media::VideoFrame::kUPlane) * i; | |
301 - uint8_t* v_row = video_frame->data(media::VideoFrame::kVPlane) + | |
302 - video_frame->stride(media::VideoFrame::kVPlane) * i; | |
303 - for (int j = 0; j < video_frame->row_bytes(media::VideoFrame::kUPlane); | |
304 - ++j) { | |
305 - u_row[j] = (u_value += 3); | |
306 - v_row[j] = (v_value += 5); | |
307 - } | |
308 - } | |
309 - uint8 alpha_value = is_transparent ? 0 : 128; | |
310 - CreateTestYUVVideoDrawQuad_FromVideoFrame( | |
311 - shared_state, video_frame, alpha_value, tex_coord_rect, render_pass); | |
312 - } | |
313 - | |
314 - void CreateTestYUVVideoDrawQuad_Solid(const SharedQuadState* shared_state, | |
315 - media::VideoFrame::Format format, | |
316 - bool is_transparent, | |
317 - const gfx::RectF& tex_coord_rect, | |
318 - uint8 y, | |
319 - uint8 u, | |
320 - uint8 v, | |
321 - RenderPass* render_pass) { | |
322 - const gfx::Rect rect(this->device_viewport_size_); | |
323 - | |
324 - scoped_refptr<media::VideoFrame> video_frame = | |
325 - media::VideoFrame::CreateFrame( | |
326 - format, rect.size(), rect, rect.size(), base::TimeDelta()); | |
327 - | |
328 - // YUV values of a solid, constant, color. Useful for testing that color | |
329 - // space/color range are being handled properly. | |
330 - memset(video_frame->data(media::VideoFrame::kYPlane), | |
331 - y, | |
332 - video_frame->stride(media::VideoFrame::kYPlane) * | |
333 - video_frame->rows(media::VideoFrame::kYPlane)); | |
334 - memset(video_frame->data(media::VideoFrame::kUPlane), | |
335 - u, | |
336 - video_frame->stride(media::VideoFrame::kUPlane) * | |
337 - video_frame->rows(media::VideoFrame::kUPlane)); | |
338 - memset(video_frame->data(media::VideoFrame::kVPlane), | |
339 - v, | |
340 - video_frame->stride(media::VideoFrame::kVPlane) * | |
341 - video_frame->rows(media::VideoFrame::kVPlane)); | |
342 - | |
343 - uint8 alpha_value = is_transparent ? 0 : 128; | |
344 - CreateTestYUVVideoDrawQuad_FromVideoFrame( | |
345 - shared_state, video_frame, alpha_value, tex_coord_rect, render_pass); | |
346 - } | |
347 - | |
348 - void CreateEdgeBleedPass(media::VideoFrame::Format format, | 274 - void CreateEdgeBleedPass(media::VideoFrame::Format format, |
349 - RenderPassList* pass_list) { | 275 - RenderPassList* pass_list) { |
350 - gfx::Rect rect(200, 200); | 276 - gfx::Rect rect(200, 200); |
351 - | 277 - |
352 - RenderPassId id(1, 1); | 278 - RenderPassId id(1, 1); |
353 - scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); | 279 - scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); |
354 - | 280 - |
355 - // Scale the video up so that bilinear filtering kicks in to sample more | 281 - // Scale the video up so that bilinear filtering kicks in to sample more |
356 - // than just nearest neighbor would. | 282 - // than just nearest neighbor would. |
357 - gfx::Transform scale_by_2; | 283 - gfx::Transform scale_by_2; |
358 - scale_by_2.Scale(2.f, 2.f); | 284 - scale_by_2.Scale(2.f, 2.f); |
359 - gfx::Rect half_rect(100, 100); | 285 - gfx::Rect half_rect(100, 100); |
360 - SharedQuadState* shared_state = | 286 - SharedQuadState* shared_state = |
361 - CreateTestSharedQuadState(scale_by_2, half_rect, pass.get()); | 287 - CreateTestSharedQuadState(scale_by_2, half_rect, pass.get()); |
362 - | 288 - |
363 - gfx::Size background_size(200, 200); | 289 - gfx::Size background_size(200, 200); |
364 - gfx::Rect green_rect(16, 20, 100, 100); | 290 - gfx::Rect green_rect(16, 20, 100, 100); |
365 - gfx::RectF tex_coord_rect( | 291 - gfx::RectF tex_coord_rect( |
366 - static_cast<float>(green_rect.x()) / background_size.width(), | 292 - static_cast<float>(green_rect.x()) / background_size.width(), |
367 - static_cast<float>(green_rect.y()) / background_size.height(), | 293 - static_cast<float>(green_rect.y()) / background_size.height(), |
368 - static_cast<float>(green_rect.width()) / background_size.width(), | 294 - static_cast<float>(green_rect.width()) / background_size.width(), |
369 - static_cast<float>(green_rect.height()) / background_size.height()); | 295 - static_cast<float>(green_rect.height()) / background_size.height()); |
370 - | 296 - |
371 - // YUV of (149,43,21) should be green (0,255,0) in RGB. | 297 - // YUV of (149,43,21) should be green (0,255,0) in RGB. |
372 - // Create a video frame that has a non-green background rect, with a | 298 - // Create a video frame that has a non-green background rect, with a |
373 - // green sub-rectangle that should be the only thing displayed in | 299 - // green sub-rectangle that should be the only thing displayed in |
374 - // the final image. Bleeding will appear on all four sides of the video | 300 - // the final image. Bleeding will appear on all four sides of the video |
375 - // if the tex coords are not clamped. | 301 - // if the tex coords are not clamped. |
376 - CreateTestYUVVideoDrawQuad_TwoColor(shared_state, format, false, | 302 - CreateTestYUVVideoDrawQuad_TwoColor( |
377 - tex_coord_rect, background_size, 0, 0, | 303 - shared_state, format, false, tex_coord_rect, background_size, 0, 0, 0, |
378 - 0, green_rect, 149, 43, 21, pass.get())
; | 304 - green_rect, 149, 43, 21, pass.get(), video_resource_updater_.get(), |
| 305 - resource_provider_.get()); |
379 - pass_list->push_back(pass.Pass()); | 306 - pass_list->push_back(pass.Pass()); |
380 - } | 307 - } |
381 - | 308 - |
382 - // Creates a video frame of size background_size filled with yuv_background, | |
383 - // and then draws a foreground rectangle in a different color on top of | |
384 - // that. The foreground rectangle must have coordinates that are divisible | |
385 - // by 2 because YUV is a block format. | |
386 - void CreateTestYUVVideoDrawQuad_TwoColor(const SharedQuadState* shared_state, | |
387 - media::VideoFrame::Format format, | |
388 - bool is_transparent, | |
389 - const gfx::RectF& tex_coord_rect, | |
390 - const gfx::Size& background_size, | |
391 - uint8 y_background, | |
392 - uint8 u_background, | |
393 - uint8 v_background, | |
394 - const gfx::Rect& foreground_rect, | |
395 - uint8 y_foreground, | |
396 - uint8 u_foreground, | |
397 - uint8 v_foreground, | |
398 - RenderPass* render_pass) { | |
399 - const gfx::Rect rect(background_size); | |
400 - | |
401 - scoped_refptr<media::VideoFrame> video_frame = | |
402 - media::VideoFrame::CreateFrame(format, background_size, foreground_rect
, | |
403 - foreground_rect.size(), | |
404 - base::TimeDelta()); | |
405 - | |
406 - int planes[] = {media::VideoFrame::kYPlane, | |
407 - media::VideoFrame::kUPlane, | |
408 - media::VideoFrame::kVPlane}; | |
409 - uint8 yuv_background[] = {y_background, u_background, v_background}; | |
410 - uint8 yuv_foreground[] = {y_foreground, u_foreground, v_foreground}; | |
411 - int sample_size[] = {1, 2, 2}; | |
412 - | |
413 - for (int i = 0; i < 3; ++i) { | |
414 - memset(video_frame->data(planes[i]), yuv_background[i], | |
415 - video_frame->stride(planes[i]) * video_frame->rows(planes[i])); | |
416 - } | |
417 - | |
418 - for (int i = 0; i < 3; ++i) { | |
419 - // Since yuv encoding uses block encoding, widths have to be divisible | |
420 - // by the sample size in order for this function to behave properly. | |
421 - DCHECK_EQ(foreground_rect.x() % sample_size[i], 0); | |
422 - DCHECK_EQ(foreground_rect.y() % sample_size[i], 0); | |
423 - DCHECK_EQ(foreground_rect.width() % sample_size[i], 0); | |
424 - DCHECK_EQ(foreground_rect.height() % sample_size[i], 0); | |
425 - | |
426 - gfx::Rect sample_rect(foreground_rect.x() / sample_size[i], | |
427 - foreground_rect.y() / sample_size[i], | |
428 - foreground_rect.width() / sample_size[i], | |
429 - foreground_rect.height() / sample_size[i]); | |
430 - for (int y = sample_rect.y(); y < sample_rect.bottom(); ++y) { | |
431 - for (int x = sample_rect.x(); x < sample_rect.right(); ++x) { | |
432 - size_t offset = y * video_frame->stride(planes[i]) + x; | |
433 - video_frame->data(planes[i])[offset] = yuv_foreground[i]; | |
434 - } | |
435 - } | |
436 - } | |
437 - | |
438 - uint8 alpha_value = 255; | |
439 - CreateTestYUVVideoDrawQuad_FromVideoFrame( | |
440 - shared_state, video_frame, alpha_value, tex_coord_rect, render_pass); | |
441 - } | |
442 - | |
443 - void CreateTestYUVVideoDrawQuad_FromVideoFrame( | |
444 - const SharedQuadState* shared_state, | |
445 - scoped_refptr<media::VideoFrame> video_frame, | |
446 - uint8 alpha_value, | |
447 - const gfx::RectF& tex_coord_rect, | |
448 - RenderPass* render_pass) { | |
449 - const bool with_alpha = (video_frame->format() == media::VideoFrame::YV12A)
; | |
450 - const YUVVideoDrawQuad::ColorSpace color_space = | |
451 - (video_frame->format() == media::VideoFrame::YV12J | |
452 - ? YUVVideoDrawQuad::JPEG | |
453 - : YUVVideoDrawQuad::REC_601); | |
454 - const gfx::Rect rect(shared_state->content_bounds); | |
455 - const gfx::Rect opaque_rect(0, 0, 0, 0); | |
456 - | |
457 - if (with_alpha) | |
458 - memset(video_frame->data(media::VideoFrame::kAPlane), alpha_value, | |
459 - video_frame->stride(media::VideoFrame::kAPlane) * | |
460 - video_frame->rows(media::VideoFrame::kAPlane)); | |
461 - | |
462 - VideoFrameExternalResources resources = | |
463 - video_resource_updater_->CreateExternalResourcesFromVideoFrame( | |
464 - video_frame); | |
465 - | |
466 - EXPECT_EQ(VideoFrameExternalResources::YUV_RESOURCE, resources.type); | |
467 - EXPECT_EQ(media::VideoFrame::NumPlanes(video_frame->format()), | |
468 - resources.mailboxes.size()); | |
469 - EXPECT_EQ(media::VideoFrame::NumPlanes(video_frame->format()), | |
470 - resources.release_callbacks.size()); | |
471 - | |
472 - ResourceProvider::ResourceId y_resource = | |
473 - resource_provider_->CreateResourceFromTextureMailbox( | |
474 - resources.mailboxes[media::VideoFrame::kYPlane], | |
475 - SingleReleaseCallbackImpl::Create( | |
476 - resources.release_callbacks[media::VideoFrame::kYPlane])); | |
477 - ResourceProvider::ResourceId u_resource = | |
478 - resource_provider_->CreateResourceFromTextureMailbox( | |
479 - resources.mailboxes[media::VideoFrame::kUPlane], | |
480 - SingleReleaseCallbackImpl::Create( | |
481 - resources.release_callbacks[media::VideoFrame::kUPlane])); | |
482 - ResourceProvider::ResourceId v_resource = | |
483 - resource_provider_->CreateResourceFromTextureMailbox( | |
484 - resources.mailboxes[media::VideoFrame::kVPlane], | |
485 - SingleReleaseCallbackImpl::Create( | |
486 - resources.release_callbacks[media::VideoFrame::kVPlane])); | |
487 - ResourceProvider::ResourceId a_resource = 0; | |
488 - if (with_alpha) { | |
489 - a_resource = resource_provider_->CreateResourceFromTextureMailbox( | |
490 - resources.mailboxes[media::VideoFrame::kAPlane], | |
491 - SingleReleaseCallbackImpl::Create( | |
492 - resources.release_callbacks[media::VideoFrame::kAPlane])); | |
493 - } | |
494 - | |
495 - YUVVideoDrawQuad* yuv_quad = | |
496 - render_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); | |
497 - yuv_quad->SetNew(shared_state, rect, opaque_rect, rect, tex_coord_rect, | |
498 - video_frame->coded_size(), y_resource, u_resource, | |
499 - v_resource, a_resource, color_space); | |
500 - } | |
501 - | |
502 - void SetUp() override { | 309 - void SetUp() override { |
503 - GLRendererPixelTest::SetUp(); | 310 - GLRendererPixelTest::SetUp(); |
504 - video_resource_updater_.reset(new VideoResourceUpdater( | 311 - video_resource_updater_.reset(new VideoResourceUpdater( |
505 - output_surface_->context_provider(), resource_provider_.get())); | 312 - output_surface_->context_provider(), resource_provider_.get())); |
506 - } | 313 - } |
507 - | 314 - |
508 - private: | |
509 - scoped_ptr<VideoResourceUpdater> video_resource_updater_; | 315 - scoped_ptr<VideoResourceUpdater> video_resource_updater_; |
510 -}; | 316 -}; |
511 - | 317 - |
512 -TEST_F(VideoGLRendererPixelTest, SimpleYUVRect) { | 318 -TEST_F(VideoGLRendererPixelTest, SimpleYUVRect) { |
513 - gfx::Rect rect(this->device_viewport_size_); | 319 - gfx::Rect rect(this->device_viewport_size_); |
514 - | 320 - |
515 - RenderPassId id(1, 1); | 321 - RenderPassId id(1, 1); |
516 - scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); | 322 - scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); |
517 - | 323 - |
518 - SharedQuadState* shared_state = | 324 - SharedQuadState* shared_state = |
519 - CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); | 325 - CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); |
520 - | 326 - |
521 - CreateTestYUVVideoDrawQuad_Striped(shared_state, | 327 - CreateTestYUVVideoDrawQuad_Striped(shared_state, media::VideoFrame::YV12, |
522 - media::VideoFrame::YV12, | 328 - false, gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), |
523 - false, | 329 - pass.get(), video_resource_updater_.get(), |
524 - gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), | 330 - rect, resource_provider_.get()); |
525 - pass.get()); | |
526 - | 331 - |
527 - RenderPassList pass_list; | 332 - RenderPassList pass_list; |
528 - pass_list.push_back(pass.Pass()); | 333 - pass_list.push_back(pass.Pass()); |
529 - | 334 - |
530 - EXPECT_TRUE( | 335 - EXPECT_TRUE( |
531 - this->RunPixelTest(&pass_list, | 336 - this->RunPixelTest(&pass_list, |
532 - base::FilePath(FILE_PATH_LITERAL("yuv_stripes.png")), | 337 - base::FilePath(FILE_PATH_LITERAL("yuv_stripes.png")), |
533 - FuzzyPixelOffByOneComparator(true))); | 338 - FuzzyPixelOffByOneComparator(true))); |
534 -} | 339 -} |
535 - | 340 - |
536 -TEST_F(VideoGLRendererPixelTest, OffsetYUVRect) { | 341 -TEST_F(VideoGLRendererPixelTest, OffsetYUVRect) { |
537 - gfx::Rect rect(this->device_viewport_size_); | 342 - gfx::Rect rect(this->device_viewport_size_); |
538 - | 343 - |
539 - RenderPassId id(1, 1); | 344 - RenderPassId id(1, 1); |
540 - scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); | 345 - scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); |
541 - | 346 - |
542 - SharedQuadState* shared_state = | 347 - SharedQuadState* shared_state = |
543 - CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); | 348 - CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); |
544 - | 349 - |
545 - // Intentionally sets frame format to I420 for testing coverage. | 350 - // Intentionally sets frame format to I420 for testing coverage. |
546 - CreateTestYUVVideoDrawQuad_Striped(shared_state, | 351 - CreateTestYUVVideoDrawQuad_Striped( |
547 - media::VideoFrame::I420, | 352 - shared_state, media::VideoFrame::I420, false, |
548 - false, | 353 - gfx::RectF(0.125f, 0.25f, 0.75f, 0.5f), pass.get(), |
549 - gfx::RectF(0.125f, 0.25f, 0.75f, 0.5f), | 354 - video_resource_updater_.get(), rect, resource_provider_.get()); |
550 - pass.get()); | |
551 - | 355 - |
552 - RenderPassList pass_list; | 356 - RenderPassList pass_list; |
553 - pass_list.push_back(pass.Pass()); | 357 - pass_list.push_back(pass.Pass()); |
554 - | 358 - |
555 - EXPECT_TRUE(this->RunPixelTest( | 359 - EXPECT_TRUE(this->RunPixelTest( |
556 - &pass_list, | 360 - &pass_list, |
557 - base::FilePath(FILE_PATH_LITERAL("yuv_stripes_offset.png")), | 361 - base::FilePath(FILE_PATH_LITERAL("yuv_stripes_offset.png")), |
558 - FuzzyPixelOffByOneComparator(true))); | 362 - FuzzyPixelOffByOneComparator(true))); |
559 -} | 363 -} |
560 - | 364 - |
561 -TEST_F(VideoGLRendererPixelTest, SimpleYUVRectBlack) { | 365 -TEST_F(VideoGLRendererPixelTest, SimpleYUVRectBlack) { |
562 - gfx::Rect rect(this->device_viewport_size_); | 366 - gfx::Rect rect(this->device_viewport_size_); |
563 - | 367 - |
564 - RenderPassId id(1, 1); | 368 - RenderPassId id(1, 1); |
565 - scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); | 369 - scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); |
566 - | 370 - |
567 - SharedQuadState* shared_state = | 371 - SharedQuadState* shared_state = |
568 - CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); | 372 - CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); |
569 - | 373 - |
570 - // In MPEG color range YUV values of (15,128,128) should produce black. | 374 - // In MPEG color range YUV values of (15,128,128) should produce black. |
571 - CreateTestYUVVideoDrawQuad_Solid(shared_state, | 375 - CreateTestYUVVideoDrawQuad_Solid( |
572 - media::VideoFrame::YV12, | 376 - shared_state, media::VideoFrame::YV12, false, |
573 - false, | 377 - gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), 15, 128, 128, pass.get(), |
574 - gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), | 378 - video_resource_updater_.get(), rect, resource_provider_.get()); |
575 - 15, | |
576 - 128, | |
577 - 128, | |
578 - pass.get()); | |
579 - | 379 - |
580 - RenderPassList pass_list; | 380 - RenderPassList pass_list; |
581 - pass_list.push_back(pass.Pass()); | 381 - pass_list.push_back(pass.Pass()); |
582 - | 382 - |
583 - // If we didn't get black out of the YUV values above, then we probably have
a | 383 - // If we didn't get black out of the YUV values above, then we probably have
a |
584 - // color range issue. | 384 - // color range issue. |
585 - EXPECT_TRUE(this->RunPixelTest(&pass_list, | 385 - EXPECT_TRUE(this->RunPixelTest(&pass_list, |
586 - base::FilePath(FILE_PATH_LITERAL("black.png"))
, | 386 - base::FilePath(FILE_PATH_LITERAL("black.png"))
, |
587 - FuzzyPixelOffByOneComparator(true))); | 387 - FuzzyPixelOffByOneComparator(true))); |
588 -} | 388 -} |
589 - | 389 - |
590 -TEST_F(VideoGLRendererPixelTest, SimpleYUVJRect) { | 390 -TEST_F(VideoGLRendererPixelTest, SimpleYUVJRect) { |
591 - gfx::Rect rect(this->device_viewport_size_); | 391 - gfx::Rect rect(this->device_viewport_size_); |
592 - | 392 - |
593 - RenderPassId id(1, 1); | 393 - RenderPassId id(1, 1); |
594 - scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); | 394 - scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); |
595 - | 395 - |
596 - SharedQuadState* shared_state = | 396 - SharedQuadState* shared_state = |
597 - CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); | 397 - CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); |
598 - | 398 - |
599 - // YUV of (149,43,21) should be green (0,255,0) in RGB. | 399 - // YUV of (149,43,21) should be green (0,255,0) in RGB. |
600 - CreateTestYUVVideoDrawQuad_Solid(shared_state, | 400 - CreateTestYUVVideoDrawQuad_Solid( |
601 - media::VideoFrame::YV12J, | 401 - shared_state, media::VideoFrame::YV12J, false, |
602 - false, | 402 - gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), 149, 43, 21, pass.get(), |
603 - gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), | 403 - video_resource_updater_.get(), rect, resource_provider_.get()); |
604 - 149, | |
605 - 43, | |
606 - 21, | |
607 - pass.get()); | |
608 - | 404 - |
609 - RenderPassList pass_list; | 405 - RenderPassList pass_list; |
610 - pass_list.push_back(pass.Pass()); | 406 - pass_list.push_back(pass.Pass()); |
611 - | 407 - |
612 - EXPECT_TRUE(this->RunPixelTest(&pass_list, | 408 - EXPECT_TRUE(this->RunPixelTest(&pass_list, |
613 - base::FilePath(FILE_PATH_LITERAL("green.png"))
, | 409 - base::FilePath(FILE_PATH_LITERAL("green.png"))
, |
614 - FuzzyPixelOffByOneComparator(true))); | 410 - FuzzyPixelOffByOneComparator(true))); |
615 -} | 411 -} |
616 - | 412 - |
617 -// Test that a YUV video doesn't bleed outside of its tex coords when the | 413 -// Test that a YUV video doesn't bleed outside of its tex coords when the |
(...skipping 17 matching lines...) Expand all Loading... |
635 -TEST_F(VideoGLRendererPixelTest, SimpleYUVJRectGrey) { | 431 -TEST_F(VideoGLRendererPixelTest, SimpleYUVJRectGrey) { |
636 - gfx::Rect rect(this->device_viewport_size_); | 432 - gfx::Rect rect(this->device_viewport_size_); |
637 - | 433 - |
638 - RenderPassId id(1, 1); | 434 - RenderPassId id(1, 1); |
639 - scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); | 435 - scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); |
640 - | 436 - |
641 - SharedQuadState* shared_state = | 437 - SharedQuadState* shared_state = |
642 - CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); | 438 - CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); |
643 - | 439 - |
644 - // Dark grey in JPEG color range (in MPEG, this is black). | 440 - // Dark grey in JPEG color range (in MPEG, this is black). |
645 - CreateTestYUVVideoDrawQuad_Solid(shared_state, | 441 - CreateTestYUVVideoDrawQuad_Solid( |
646 - media::VideoFrame::YV12J, | 442 - shared_state, media::VideoFrame::YV12J, false, |
647 - false, | 443 - gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), 15, 128, 128, pass.get(), |
648 - gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), | 444 - video_resource_updater_.get(), rect, resource_provider_.get()); |
649 - 15, | |
650 - 128, | |
651 - 128, | |
652 - pass.get()); | |
653 - | 445 - |
654 - RenderPassList pass_list; | 446 - RenderPassList pass_list; |
655 - pass_list.push_back(pass.Pass()); | 447 - pass_list.push_back(pass.Pass()); |
656 - | 448 - |
657 - EXPECT_TRUE( | 449 - EXPECT_TRUE( |
658 - this->RunPixelTest(&pass_list, | 450 - this->RunPixelTest(&pass_list, |
659 - base::FilePath(FILE_PATH_LITERAL("dark_grey.png")), | 451 - base::FilePath(FILE_PATH_LITERAL("dark_grey.png")), |
660 - FuzzyPixelOffByOneComparator(true))); | 452 - FuzzyPixelOffByOneComparator(true))); |
661 -} | 453 -} |
662 - | 454 - |
663 -TEST_F(VideoGLRendererPixelTest, SimpleYUVARect) { | 455 -TEST_F(VideoGLRendererPixelTest, SimpleYUVARect) { |
664 - gfx::Rect rect(this->device_viewport_size_); | 456 - gfx::Rect rect(this->device_viewport_size_); |
665 - | 457 - |
666 - RenderPassId id(1, 1); | 458 - RenderPassId id(1, 1); |
667 - scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); | 459 - scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); |
668 - | 460 - |
669 - SharedQuadState* shared_state = | 461 - SharedQuadState* shared_state = |
670 - CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); | 462 - CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); |
671 - | 463 - |
672 - CreateTestYUVVideoDrawQuad_Striped(shared_state, | 464 - CreateTestYUVVideoDrawQuad_Striped(shared_state, media::VideoFrame::YV12A, |
673 - media::VideoFrame::YV12A, | 465 - false, gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), |
674 - false, | 466 - pass.get(), video_resource_updater_.get(), |
675 - gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), | 467 - rect, resource_provider_.get()); |
676 - pass.get()); | |
677 - | 468 - |
678 - SolidColorDrawQuad* color_quad = | 469 - SolidColorDrawQuad* color_quad = |
679 - pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | 470 - pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); |
680 - color_quad->SetNew(shared_state, rect, rect, SK_ColorWHITE, false); | 471 - color_quad->SetNew(shared_state, rect, rect, SK_ColorWHITE, false); |
681 - | 472 - |
682 - RenderPassList pass_list; | 473 - RenderPassList pass_list; |
683 - pass_list.push_back(pass.Pass()); | 474 - pass_list.push_back(pass.Pass()); |
684 - | 475 - |
685 - EXPECT_TRUE(this->RunPixelTest( | 476 - EXPECT_TRUE(this->RunPixelTest( |
686 - &pass_list, | 477 - &pass_list, |
687 - base::FilePath(FILE_PATH_LITERAL("yuv_stripes_alpha.png")), | 478 - base::FilePath(FILE_PATH_LITERAL("yuv_stripes_alpha.png")), |
688 - FuzzyPixelOffByOneComparator(true))); | 479 - FuzzyPixelOffByOneComparator(true))); |
689 -} | 480 -} |
690 - | 481 - |
691 -TEST_F(VideoGLRendererPixelTest, FullyTransparentYUVARect) { | 482 -TEST_F(VideoGLRendererPixelTest, FullyTransparentYUVARect) { |
692 - gfx::Rect rect(this->device_viewport_size_); | 483 - gfx::Rect rect(this->device_viewport_size_); |
693 - | 484 - |
694 - RenderPassId id(1, 1); | 485 - RenderPassId id(1, 1); |
695 - scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); | 486 - scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); |
696 - | 487 - |
697 - SharedQuadState* shared_state = | 488 - SharedQuadState* shared_state = |
698 - CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); | 489 - CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); |
699 - | 490 - |
700 - CreateTestYUVVideoDrawQuad_Striped(shared_state, | 491 - CreateTestYUVVideoDrawQuad_Striped(shared_state, media::VideoFrame::YV12A, |
701 - media::VideoFrame::YV12A, | 492 - true, gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), |
702 - true, | 493 - pass.get(), video_resource_updater_.get(), |
703 - gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), | 494 - rect, resource_provider_.get()); |
704 - pass.get()); | |
705 - | 495 - |
706 - SolidColorDrawQuad* color_quad = | 496 - SolidColorDrawQuad* color_quad = |
707 - pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | 497 - pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); |
708 - color_quad->SetNew(shared_state, rect, rect, SK_ColorBLACK, false); | 498 - color_quad->SetNew(shared_state, rect, rect, SK_ColorBLACK, false); |
709 - | 499 - |
710 - RenderPassList pass_list; | 500 - RenderPassList pass_list; |
711 - pass_list.push_back(pass.Pass()); | 501 - pass_list.push_back(pass.Pass()); |
712 - | 502 - |
713 - EXPECT_TRUE(this->RunPixelTest( | 503 - EXPECT_TRUE(this->RunPixelTest( |
714 - &pass_list, | 504 - &pass_list, |
715 - base::FilePath(FILE_PATH_LITERAL("black.png")), | 505 - base::FilePath(FILE_PATH_LITERAL("black.png")), |
716 - ExactPixelComparator(true))); | 506 - ExactPixelComparator(true))); |
717 -} | 507 -} |
718 - | 508 - |
719 TYPED_TEST(RendererPixelTest, FastPassColorFilterAlpha) { | 509 TYPED_TEST(RendererPixelTest, FastPassColorFilterAlpha) { |
720 gfx::Rect viewport_rect(this->device_viewport_size_); | 510 gfx::Rect viewport_rect(this->device_viewport_size_); |
721 | 511 |
722 diff --git a/cc/quads/yuv_video_draw_quad.h b/cc/quads/yuv_video_draw_quad.h | 512 diff --git a/cc/quads/yuv_video_draw_quad.h b/cc/quads/yuv_video_draw_quad.h |
723 index 358929e..15bce98 100644 | 513 index 358929e..15bce98 100644 |
724 --- a/cc/quads/yuv_video_draw_quad.h | 514 --- a/cc/quads/yuv_video_draw_quad.h |
725 +++ b/cc/quads/yuv_video_draw_quad.h | 515 +++ b/cc/quads/yuv_video_draw_quad.h |
726 @@ -8,7 +8,6 @@ | 516 @@ -8,7 +8,6 @@ |
727 #include "base/basictypes.h" | 517 #include "base/basictypes.h" |
728 #include "base/memory/scoped_ptr.h" | 518 #include "base/memory/scoped_ptr.h" |
729 #include "cc/base/cc_export.h" | 519 #include "cc/base/cc_export.h" |
730 -#include "cc/layers/video_layer_impl.h" | 520 -#include "cc/layers/video_layer_impl.h" |
731 #include "cc/quads/draw_quad.h" | 521 #include "cc/quads/draw_quad.h" |
732 | 522 |
733 namespace cc { | 523 namespace cc { |
734 diff --git a/cc/resources/drawing_display_item.cc b/cc/resources/drawing_display
_item.cc | 524 diff --git a/cc/resources/drawing_display_item.cc b/cc/resources/drawing_display
_item.cc |
735 index 648f9de..6dffad9 100644 | 525 index 648f9de..6dffad9 100644 |
736 --- a/cc/resources/drawing_display_item.cc | 526 --- a/cc/resources/drawing_display_item.cc |
737 +++ b/cc/resources/drawing_display_item.cc | 527 +++ b/cc/resources/drawing_display_item.cc |
738 @@ -6,6 +6,7 @@ | 528 @@ -6,6 +6,7 @@ |
739 | 529 |
740 #include <string> | 530 #include <string> |
741 | 531 |
742 +#include "base/logging.h" | 532 +#include "base/logging.h" |
743 #include "base/strings/stringprintf.h" | 533 #include "base/strings/stringprintf.h" |
744 #include "base/trace_event/trace_event_argument.h" | 534 #include "base/trace_event/trace_event_argument.h" |
745 #include "cc/debug/picture_debug_util.h" | 535 #include "cc/debug/picture_debug_util.h" |
746 diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_hos
t_impl_unittest.cc | 536 diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_hos
t_impl_unittest.cc |
747 index 4b2bc75..7ffa683 100644 | 537 index 4289a99..4e3230b 100644 |
748 --- a/cc/trees/layer_tree_host_impl_unittest.cc | 538 --- a/cc/trees/layer_tree_host_impl_unittest.cc |
749 +++ b/cc/trees/layer_tree_host_impl_unittest.cc | 539 +++ b/cc/trees/layer_tree_host_impl_unittest.cc |
750 @@ -27,7 +27,6 @@ | 540 @@ -27,7 +27,6 @@ |
751 #include "cc/layers/solid_color_scrollbar_layer_impl.h" | 541 #include "cc/layers/solid_color_scrollbar_layer_impl.h" |
752 #include "cc/layers/texture_layer_impl.h" | 542 #include "cc/layers/texture_layer_impl.h" |
753 #include "cc/layers/tiled_layer_impl.h" | 543 #include "cc/layers/tiled_layer_impl.h" |
754 -#include "cc/layers/video_layer_impl.h" | 544 -#include "cc/layers/video_layer_impl.h" |
755 #include "cc/output/begin_frame_args.h" | 545 #include "cc/output/begin_frame_args.h" |
756 #include "cc/output/compositor_frame_ack.h" | 546 #include "cc/output/compositor_frame_ack.h" |
757 #include "cc/output/compositor_frame_metadata.h" | 547 #include "cc/output/compositor_frame_metadata.h" |
(...skipping 11 matching lines...) Expand all Loading... |
769 #include "cc/trees/single_thread_proxy.h" | 559 #include "cc/trees/single_thread_proxy.h" |
770 -#include "media/base/media.h" | 560 -#include "media/base/media.h" |
771 #include "testing/gmock/include/gmock/gmock.h" | 561 #include "testing/gmock/include/gmock/gmock.h" |
772 #include "testing/gtest/include/gtest/gtest.h" | 562 #include "testing/gtest/include/gtest/gtest.h" |
773 #include "third_party/skia/include/core/SkMallocPixelRef.h" | 563 #include "third_party/skia/include/core/SkMallocPixelRef.h" |
774 @@ -71,7 +68,6 @@ using ::testing::Return; | 564 @@ -71,7 +68,6 @@ using ::testing::Return; |
775 using ::testing::AnyNumber; | 565 using ::testing::AnyNumber; |
776 using ::testing::AtLeast; | 566 using ::testing::AtLeast; |
777 using ::testing::_; | 567 using ::testing::_; |
778 -using media::VideoFrame; | 568 -using media::VideoFrame; |
779 | 569 |
780 namespace cc { | 570 namespace cc { |
781 namespace { | 571 namespace { |
782 @@ -96,7 +92,6 @@ class LayerTreeHostImplTest : public testing::Test, | 572 @@ -96,7 +92,6 @@ class LayerTreeHostImplTest : public testing::Test, |
783 reduce_memory_result_(true), | 573 reduce_memory_result_(true), |
784 current_limit_bytes_(0), | 574 current_limit_bytes_(0), |
785 current_priority_cutoff_value_(0) { | 575 current_priority_cutoff_value_(0) { |
786 - media::InitializeMediaLibraryForTesting(); | 576 - media::InitializeMediaLibraryForTesting(); |
787 } | 577 } |
788 | 578 |
789 LayerTreeSettings DefaultSettings() { | 579 LayerTreeSettings DefaultSettings() { |
790 @@ -5486,18 +5481,6 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) { | 580 @@ -5473,18 +5468,6 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) { |
791 root_layer->SetBounds(gfx::Size(10, 10)); | 581 root_layer->SetBounds(gfx::Size(10, 10)); |
792 root_layer->SetHasRenderSurface(true); | 582 root_layer->SetHasRenderSurface(true); |
793 | 583 |
794 - scoped_refptr<VideoFrame> softwareFrame = | 584 - scoped_refptr<VideoFrame> softwareFrame = |
795 - media::VideoFrame::CreateColorFrame( | 585 - media::VideoFrame::CreateColorFrame( |
796 - gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); | 586 - gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); |
797 - FakeVideoFrameProvider provider; | 587 - FakeVideoFrameProvider provider; |
798 - provider.set_frame(softwareFrame); | 588 - provider.set_frame(softwareFrame); |
799 - scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create( | 589 - scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create( |
800 - host_impl_->active_tree(), 4, &provider, media::VIDEO_ROTATION_0); | 590 - host_impl_->active_tree(), 4, &provider, media::VIDEO_ROTATION_0); |
801 - video_layer->SetBounds(gfx::Size(10, 10)); | 591 - video_layer->SetBounds(gfx::Size(10, 10)); |
802 - video_layer->SetContentBounds(gfx::Size(10, 10)); | 592 - video_layer->SetContentBounds(gfx::Size(10, 10)); |
803 - video_layer->SetDrawsContent(true); | 593 - video_layer->SetDrawsContent(true); |
804 - root_layer->AddChild(video_layer.Pass()); | 594 - root_layer->AddChild(video_layer.Pass()); |
805 - | 595 - |
806 scoped_ptr<IOSurfaceLayerImpl> io_surface_layer = | 596 scoped_ptr<IOSurfaceLayerImpl> io_surface_layer = |
807 IOSurfaceLayerImpl::Create(host_impl_->active_tree(), 5); | 597 IOSurfaceLayerImpl::Create(host_impl_->active_tree(), 5); |
808 io_surface_layer->SetBounds(gfx::Size(10, 10)); | 598 io_surface_layer->SetBounds(gfx::Size(10, 10)); |
809 @@ -6578,16 +6561,6 @@ TEST_F(LayerTreeHostImplTest, | 599 @@ -6566,16 +6549,6 @@ TEST_F(LayerTreeHostImplTest, |
810 scoped_ptr<SolidColorLayerImpl> root_layer = | 600 scoped_ptr<SolidColorLayerImpl> root_layer = |
811 SolidColorLayerImpl::Create(host_impl_->active_tree(), 1); | 601 SolidColorLayerImpl::Create(host_impl_->active_tree(), 1); |
812 | 602 |
813 - // VideoLayerImpl will not be drawn. | 603 - // VideoLayerImpl will not be drawn. |
814 - FakeVideoFrameProvider provider; | 604 - FakeVideoFrameProvider provider; |
815 - scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create( | 605 - scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create( |
816 - host_impl_->active_tree(), 2, &provider, media::VIDEO_ROTATION_0); | 606 - host_impl_->active_tree(), 2, &provider, media::VIDEO_ROTATION_0); |
817 - video_layer->SetBounds(gfx::Size(10, 10)); | 607 - video_layer->SetBounds(gfx::Size(10, 10)); |
818 - video_layer->SetContentBounds(gfx::Size(10, 10)); | 608 - video_layer->SetContentBounds(gfx::Size(10, 10)); |
819 - video_layer->SetDrawsContent(true); | 609 - video_layer->SetDrawsContent(true); |
820 - root_layer->AddChild(video_layer.Pass()); | 610 - root_layer->AddChild(video_layer.Pass()); |
821 - SetupRootLayerImpl(root_layer.Pass()); | 611 - SetupRootLayerImpl(root_layer.Pass()); |
822 - | 612 - |
823 LayerTreeHostImpl::FrameData frame; | 613 LayerTreeHostImpl::FrameData frame; |
824 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); | 614 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
825 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); | 615 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); |
826 diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_uni
ttest.cc | 616 diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_uni
ttest.cc |
827 index c52132e..1be61a5 100644 | 617 index 68a1f58..2ec6e66 100644 |
828 --- a/cc/trees/layer_tree_host_unittest.cc | 618 --- a/cc/trees/layer_tree_host_unittest.cc |
829 +++ b/cc/trees/layer_tree_host_unittest.cc | 619 +++ b/cc/trees/layer_tree_host_unittest.cc |
830 @@ -18,7 +18,6 @@ | 620 @@ -18,7 +18,6 @@ |
831 #include "cc/layers/painted_scrollbar_layer.h" | 621 #include "cc/layers/painted_scrollbar_layer.h" |
832 #include "cc/layers/picture_layer.h" | 622 #include "cc/layers/picture_layer.h" |
833 #include "cc/layers/solid_color_layer.h" | 623 #include "cc/layers/solid_color_layer.h" |
834 -#include "cc/layers/video_layer.h" | 624 -#include "cc/layers/video_layer.h" |
835 #include "cc/output/begin_frame_args.h" | 625 #include "cc/output/begin_frame_args.h" |
836 #include "cc/output/compositor_frame_ack.h" | 626 #include "cc/output/compositor_frame_ack.h" |
837 #include "cc/output/copy_output_request.h" | 627 #include "cc/output/copy_output_request.h" |
838 @@ -41,7 +40,6 @@ | 628 @@ -41,7 +40,6 @@ |
839 #include "cc/test/fake_picture_pile.h" | 629 #include "cc/test/fake_picture_pile.h" |
840 #include "cc/test/fake_proxy.h" | 630 #include "cc/test/fake_proxy.h" |
841 #include "cc/test/fake_scoped_ui_resource.h" | 631 #include "cc/test/fake_scoped_ui_resource.h" |
842 -#include "cc/test/fake_video_frame_provider.h" | 632 -#include "cc/test/fake_video_frame_provider.h" |
843 #include "cc/test/geometry_test_utils.h" | 633 #include "cc/test/geometry_test_utils.h" |
844 #include "cc/test/impl_side_painting_settings.h" | 634 #include "cc/test/impl_side_painting_settings.h" |
845 #include "cc/test/layer_tree_test.h" | 635 #include "cc/test/layer_tree_test.h" |
846 @@ -4163,28 +4161,6 @@ class LayerInvalidateCausesDraw : public LayerTreeHostTes
t { | 636 @@ -4170,28 +4168,6 @@ class LayerInvalidateCausesDraw : public LayerTreeHostTes
t { |
847 int num_draws_; | 637 int num_draws_; |
848 }; | 638 }; |
849 | 639 |
850 -// VideoLayer must support being invalidated and then passing that along | 640 -// VideoLayer must support being invalidated and then passing that along |
851 -// to the compositor thread, even though no resources are updated in | 641 -// to the compositor thread, even though no resources are updated in |
852 -// response to that invalidation. | 642 -// response to that invalidation. |
853 -class LayerTreeHostTestVideoLayerInvalidate : public LayerInvalidateCausesDraw
{ | 643 -class LayerTreeHostTestVideoLayerInvalidate : public LayerInvalidateCausesDraw
{ |
854 - public: | 644 - public: |
855 - void SetupTree() override { | 645 - void SetupTree() override { |
856 - LayerTreeHostTest::SetupTree(); | 646 - LayerTreeHostTest::SetupTree(); |
857 - scoped_refptr<VideoLayer> video_layer = | 647 - scoped_refptr<VideoLayer> video_layer = |
858 - VideoLayer::Create(&provider_, media::VIDEO_ROTATION_0); | 648 - VideoLayer::Create(&provider_, media::VIDEO_ROTATION_0); |
859 - video_layer->SetBounds(gfx::Size(10, 10)); | 649 - video_layer->SetBounds(gfx::Size(10, 10)); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 #include "cc/test/layer_tree_test.h" | 683 #include "cc/test/layer_tree_test.h" |
894 #include "cc/test/render_pass_test_common.h" | 684 #include "cc/test/render_pass_test_common.h" |
895 #include "cc/test/test_context_provider.h" | 685 #include "cc/test/test_context_provider.h" |
896 @@ -43,9 +40,6 @@ | 686 @@ -43,9 +40,6 @@ |
897 #include "cc/trees/layer_tree_impl.h" | 687 #include "cc/trees/layer_tree_impl.h" |
898 #include "cc/trees/single_thread_proxy.h" | 688 #include "cc/trees/single_thread_proxy.h" |
899 #include "gpu/GLES2/gl2extchromium.h" | 689 #include "gpu/GLES2/gl2extchromium.h" |
900 -#include "media/base/media.h" | 690 -#include "media/base/media.h" |
901 - | 691 - |
902 -using media::VideoFrame; | 692 -using media::VideoFrame; |
903 | 693 |
904 namespace cc { | 694 namespace cc { |
905 namespace { | 695 namespace { |
906 @@ -66,7 +60,6 @@ class LayerTreeHostContextTest : public LayerTreeTest { | 696 @@ -66,7 +60,6 @@ class LayerTreeHostContextTest : public LayerTreeTest { |
907 context_should_support_io_surface_(false), | 697 context_should_support_io_surface_(false), |
908 fallback_context_works_(false), | 698 fallback_context_works_(false), |
909 async_output_surface_creation_(false) { | 699 async_output_surface_creation_(false) { |
910 - media::InitializeMediaLibraryForTesting(); | 700 - media::InitializeMediaLibraryForTesting(); |
911 } | 701 } |
912 | 702 |
913 void LoseContext() { | 703 void LoseContext() { |
914 @@ -1055,41 +1048,6 @@ class LayerTreeHostContextTestDontUseLostResources | 704 @@ -1055,41 +1048,6 @@ class LayerTreeHostContextTestDontUseLostResources |
915 layer_with_mask->SetMaskLayer(mask.get()); | 705 layer_with_mask->SetMaskLayer(mask.get()); |
916 root->AddChild(layer_with_mask); | 706 root->AddChild(layer_with_mask); |
917 | 707 |
918 - scoped_refptr<VideoLayer> video_color = | 708 - scoped_refptr<VideoLayer> video_color = |
919 - VideoLayer::Create(&color_frame_provider_, media::VIDEO_ROTATION_0); | 709 - VideoLayer::Create(&color_frame_provider_, media::VIDEO_ROTATION_0); |
920 - video_color->SetBounds(gfx::Size(10, 10)); | 710 - video_color->SetBounds(gfx::Size(10, 10)); |
921 - video_color->SetIsDrawable(true); | 711 - video_color->SetIsDrawable(true); |
922 - root->AddChild(video_color); | 712 - root->AddChild(video_color); |
923 - | 713 - |
924 - scoped_refptr<VideoLayer> video_hw = | 714 - scoped_refptr<VideoLayer> video_hw = |
925 - VideoLayer::Create(&hw_frame_provider_, media::VIDEO_ROTATION_0); | 715 - VideoLayer::Create(&hw_frame_provider_, media::VIDEO_ROTATION_0); |
926 - video_hw->SetBounds(gfx::Size(10, 10)); | 716 - video_hw->SetBounds(gfx::Size(10, 10)); |
927 - video_hw->SetIsDrawable(true); | 717 - video_hw->SetIsDrawable(true); |
(...skipping 19 matching lines...) Expand all Loading... |
947 - gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4), base::TimeDelta(), false); | 737 - gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4), base::TimeDelta(), false); |
948 - | 738 - |
949 - color_frame_provider_.set_frame(color_video_frame_); | 739 - color_frame_provider_.set_frame(color_video_frame_); |
950 - hw_frame_provider_.set_frame(hw_video_frame_); | 740 - hw_frame_provider_.set_frame(hw_video_frame_); |
951 - scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_); | 741 - scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_); |
952 - | 742 - |
953 if (!delegating_renderer()) { | 743 if (!delegating_renderer()) { |
954 // TODO(danakj): IOSurface layer can not be transported. crbug.com/239335 | 744 // TODO(danakj): IOSurface layer can not be transported. crbug.com/239335 |
955 scoped_refptr<IOSurfaceLayer> io_surface = IOSurfaceLayer::Create(); | 745 scoped_refptr<IOSurfaceLayer> io_surface = IOSurfaceLayer::Create(); |
956 @@ -1119,14 +1077,6 @@ class LayerTreeHostContextTestDontUseLostResources | 746 @@ -1119,14 +1077,6 @@ class LayerTreeHostContextTestDontUseLostResources |
957 | 747 |
958 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { | 748 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { |
959 LayerTreeHostContextTest::CommitCompleteOnThread(host_impl); | 749 LayerTreeHostContextTest::CommitCompleteOnThread(host_impl); |
960 - | 750 - |
961 - if (host_impl->active_tree()->source_frame_number() == 3) { | 751 - if (host_impl->active_tree()->source_frame_number() == 3) { |
962 - // On the third commit we're recovering from context loss. Hardware | 752 - // On the third commit we're recovering from context loss. Hardware |
963 - // video frames should not be reused by the VideoFrameProvider, but | 753 - // video frames should not be reused by the VideoFrameProvider, but |
964 - // software frames can be. | 754 - // software frames can be. |
965 - hw_frame_provider_.set_frame(NULL); | 755 - hw_frame_provider_.set_frame(NULL); |
966 - scaled_hw_frame_provider_.set_frame(NULL); | 756 - scaled_hw_frame_provider_.set_frame(NULL); |
967 - } | 757 - } |
968 } | 758 } |
969 | 759 |
970 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, | 760 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
971 @@ -1175,14 +1125,6 @@ class LayerTreeHostContextTestDontUseLostResources | 761 @@ -1175,14 +1125,6 @@ class LayerTreeHostContextTestDontUseLostResources |
972 scoped_refptr<DelegatedFrameResourceCollection> | 762 scoped_refptr<DelegatedFrameResourceCollection> |
973 delegated_resource_collection_; | 763 delegated_resource_collection_; |
974 scoped_refptr<DelegatedFrameProvider> delegated_frame_provider_; | 764 scoped_refptr<DelegatedFrameProvider> delegated_frame_provider_; |
975 - | 765 - |
976 - scoped_refptr<VideoFrame> color_video_frame_; | 766 - scoped_refptr<VideoFrame> color_video_frame_; |
977 - scoped_refptr<VideoFrame> hw_video_frame_; | 767 - scoped_refptr<VideoFrame> hw_video_frame_; |
978 - scoped_refptr<VideoFrame> scaled_hw_video_frame_; | 768 - scoped_refptr<VideoFrame> scaled_hw_video_frame_; |
979 - | 769 - |
980 - FakeVideoFrameProvider color_frame_provider_; | 770 - FakeVideoFrameProvider color_frame_provider_; |
981 - FakeVideoFrameProvider hw_frame_provider_; | 771 - FakeVideoFrameProvider hw_frame_provider_; |
982 - FakeVideoFrameProvider scaled_hw_frame_provider_; | 772 - FakeVideoFrameProvider scaled_hw_frame_provider_; |
983 }; | 773 }; |
984 | 774 |
985 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources); | 775 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources); |
OLD | NEW |