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

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

Issue 850993002: gpu video: optimize HW video to SW canvas and implement it for WebRTC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
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/barrier_closure.h" 5 #include "base/barrier_closure.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/message_loop/message_loop_proxy.h" 7 #include "base/message_loop/message_loop_proxy.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "content/browser/gpu/compositor_util.h" 10 #include "content/browser/gpu/compositor_util.h"
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 return; 469 return;
470 } 470 }
471 471
472 media::SkCanvasVideoRenderer video_renderer; 472 media::SkCanvasVideoRenderer video_renderer;
473 473
474 SkBitmap bitmap; 474 SkBitmap bitmap;
475 bitmap.allocN32Pixels(video_frame->visible_rect().width(), 475 bitmap.allocN32Pixels(video_frame->visible_rect().width(),
476 video_frame->visible_rect().height()); 476 video_frame->visible_rect().height());
477 // Don't clear the canvas because drawing a video frame by Src mode. 477 // Don't clear the canvas because drawing a video frame by Src mode.
478 SkCanvas canvas(bitmap); 478 SkCanvas canvas(bitmap);
479 video_renderer.Copy(video_frame, &canvas); 479 video_renderer.Copy(video_frame, &canvas, media::Context3D());
480 ReadbackResponse response = result ? READBACK_SUCCESS : READBACK_FAILED; 480 ReadbackResponse response = result ? READBACK_SUCCESS : READBACK_FAILED;
481 481
482 ReadbackRequestCallbackTest(quit_callback, bitmap, response); 482 ReadbackRequestCallbackTest(quit_callback, bitmap, response);
483 } 483 }
484 484
485 void SetExpectedCopyFromCompositingSurfaceResult(bool result, 485 void SetExpectedCopyFromCompositingSurfaceResult(bool result,
486 const SkBitmap& bitmap) { 486 const SkBitmap& bitmap) {
487 expected_copy_from_compositing_surface_result_ = result; 487 expected_copy_from_compositing_surface_result_ = result;
488 expected_copy_from_compositing_surface_bitmap_ = bitmap; 488 expected_copy_from_compositing_surface_bitmap_ = bitmap;
489 } 489 }
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING)); 910 testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING));
911 INSTANTIATE_TEST_CASE_P( 911 INSTANTIATE_TEST_CASE_P(
912 GLAndSoftwareCompositing, 912 GLAndSoftwareCompositing,
913 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, 913 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI,
914 testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING)); 914 testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING));
915 915
916 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) 916 #endif // !defined(OS_ANDROID) && !defined(OS_IOS)
917 917
918 } // namespace 918 } // namespace
919 } // namespace content 919 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698