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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_browsertest.cc

Issue 21458003: Enable software compositing in renderer for win aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/message_loop/message_loop_proxy.h" 6 #include "base/message_loop/message_loop_proxy.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "content/browser/gpu/gpu_data_manager_impl.h" 9 #include "content/browser/gpu/gpu_data_manager_impl.h"
10 #include "content/browser/renderer_host/dip_util.h" 10 #include "content/browser/renderer_host/dip_util.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 }; 322 };
323 323
324 // Disable tests for Android and IOS as these platforms have incomplete 324 // Disable tests for Android and IOS as these platforms have incomplete
325 // implementation. 325 // implementation.
326 #if !defined(OS_ANDROID) && !defined(OS_IOS) 326 #if !defined(OS_ANDROID) && !defined(OS_IOS)
327 327
328 // The CopyFromBackingStore() API should work on all platforms when compositing 328 // The CopyFromBackingStore() API should work on all platforms when compositing
329 // is enabled. 329 // is enabled.
330 IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTest, 330 IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTest,
331 CopyFromBackingStore) { 331 CopyFromBackingStore) {
332 #if defined(USE_AURA)
333 if (ui::IsTestCompositorEnabled()) {
334 LOG(WARNING) << ("Blindly passing this test: Aura test compositor doesn't "
335 "support copying from backing store.");
336 // TODO(jbauman): Aura test compositor should support copying from backing
337 // store. http://crbug.com/268644
338 return;
339 }
340 #endif
332 RunBasicCopyFromBackingStoreTest(); 341 RunBasicCopyFromBackingStoreTest();
333 } 342 }
334 343
335 // The CopyFromBackingStore() API should work on all platforms when compositing 344 // The CopyFromBackingStore() API should work on all platforms when compositing
336 // is disabled. 345 // is disabled.
337 IN_PROC_BROWSER_TEST_F(NonCompositingRenderWidgetHostViewBrowserTest, 346 IN_PROC_BROWSER_TEST_F(NonCompositingRenderWidgetHostViewBrowserTest,
338 CopyFromBackingStore) { 347 CopyFromBackingStore) {
339 RunBasicCopyFromBackingStoreTest(); 348 RunBasicCopyFromBackingStoreTest();
340 } 349 }
341 350
(...skipping 22 matching lines...) Expand all
364 IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTest, 373 IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTest,
365 CopyFromCompositingSurface_CallbackDespiteDelete) { 374 CopyFromCompositingSurface_CallbackDespiteDelete) {
366 SET_UP_SURFACE_OR_PASS_TEST(NULL); 375 SET_UP_SURFACE_OR_PASS_TEST(NULL);
367 RenderWidgetHostViewPort* const view = GetRenderWidgetHostViewPort(); 376 RenderWidgetHostViewPort* const view = GetRenderWidgetHostViewPort();
368 if (!view->CanCopyToVideoFrame()) { 377 if (!view->CanCopyToVideoFrame()) {
369 LOG(WARNING) << 378 LOG(WARNING) <<
370 ("Blindly passing this test: CopyFromCompositingSurfaceToVideoFrame() " 379 ("Blindly passing this test: CopyFromCompositingSurfaceToVideoFrame() "
371 "not supported on this platform."); 380 "not supported on this platform.");
372 return; 381 return;
373 } 382 }
374
375 base::RunLoop run_loop; 383 base::RunLoop run_loop;
376 scoped_refptr<media::VideoFrame> dest = 384 scoped_refptr<media::VideoFrame> dest =
377 media::VideoFrame::CreateBlackFrame(frame_size()); 385 media::VideoFrame::CreateBlackFrame(frame_size());
378 view->CopyFromCompositingSurfaceToVideoFrame( 386 view->CopyFromCompositingSurfaceToVideoFrame(
379 gfx::Rect(view->GetViewBounds().size()), dest, base::Bind( 387 gfx::Rect(view->GetViewBounds().size()), dest, base::Bind(
380 &RenderWidgetHostViewBrowserTest::FinishCopyFromCompositingSurface, 388 &RenderWidgetHostViewBrowserTest::FinishCopyFromCompositingSurface,
381 base::Unretained(this), run_loop.QuitClosure())); 389 base::Unretained(this), run_loop.QuitClosure()));
382 // Delete the surface before the callback is run. 390 // Delete the surface before the callback is run.
383 view->AcceleratedSurfaceRelease(); 391 view->AcceleratedSurfaceRelease();
384 run_loop.Run(); 392 run_loop.Run();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTest, CopyTwice) { 442 IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTest, CopyTwice) {
435 SET_UP_SURFACE_OR_PASS_TEST(NULL); 443 SET_UP_SURFACE_OR_PASS_TEST(NULL);
436 RenderWidgetHostViewPort* const view = GetRenderWidgetHostViewPort(); 444 RenderWidgetHostViewPort* const view = GetRenderWidgetHostViewPort();
437 if (!view->CanCopyToVideoFrame()) { 445 if (!view->CanCopyToVideoFrame()) {
438 LOG(WARNING) << ("Blindly passing this test: " 446 LOG(WARNING) << ("Blindly passing this test: "
439 "CopyFromCompositingSurfaceToVideoFrame() not supported " 447 "CopyFromCompositingSurfaceToVideoFrame() not supported "
440 "on this platform."); 448 "on this platform.");
441 return; 449 return;
442 } 450 }
443 451
452 #if defined(USE_AURA)
453 if (ui::IsTestCompositorEnabled()) {
454 LOG(WARNING) << ("Blindly passing this test: Aura test compositor doesn't "
455 "support copying to video frame.");
456 // TODO(jbauman): Aura test compositor should support copying to video
457 // frame. http://crbug.com/268644
458 return;
459 }
460 #endif
461
444 base::RunLoop run_loop; 462 base::RunLoop run_loop;
445 scoped_refptr<media::VideoFrame> first_output = 463 scoped_refptr<media::VideoFrame> first_output =
446 media::VideoFrame::CreateBlackFrame(frame_size()); 464 media::VideoFrame::CreateBlackFrame(frame_size());
447 ASSERT_TRUE(first_output.get()); 465 ASSERT_TRUE(first_output.get());
448 scoped_refptr<media::VideoFrame> second_output = 466 scoped_refptr<media::VideoFrame> second_output =
449 media::VideoFrame::CreateBlackFrame(frame_size()); 467 media::VideoFrame::CreateBlackFrame(frame_size());
450 ASSERT_TRUE(second_output.get()); 468 ASSERT_TRUE(second_output.get());
451 view->CopyFromCompositingSurfaceToVideoFrame( 469 view->CopyFromCompositingSurfaceToVideoFrame(
452 gfx::Rect(view->GetViewBounds().size()), 470 gfx::Rect(view->GetViewBounds().size()),
453 first_output, 471 first_output,
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 copy_rect, 903 copy_rect,
886 output_size, 904 output_size,
887 expected_bitmap_size, 905 expected_bitmap_size,
888 video_frame); 906 video_frame);
889 } 907 }
890 908
891 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) 909 #endif // !defined(OS_ANDROID) && !defined(OS_IOS)
892 910
893 } // namespace 911 } // namespace
894 } // namespace content 912 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698