OLD | NEW |
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/compositor_util.h" | 9 #include "content/browser/gpu/compositor_util.h" |
10 #include "content/browser/gpu/gpu_data_manager_impl.h" | 10 #include "content/browser/gpu/gpu_data_manager_impl.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 DISALLOW_COPY_AND_ASSIGN(CompositingRenderWidgetHostViewBrowserTest); | 240 DISALLOW_COPY_AND_ASSIGN(CompositingRenderWidgetHostViewBrowserTest); |
241 }; | 241 }; |
242 | 242 |
243 class FakeFrameSubscriber : public RenderWidgetHostViewFrameSubscriber { | 243 class FakeFrameSubscriber : public RenderWidgetHostViewFrameSubscriber { |
244 public: | 244 public: |
245 FakeFrameSubscriber( | 245 FakeFrameSubscriber( |
246 RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback callback) | 246 RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback callback) |
247 : callback_(callback) { | 247 : callback_(callback) { |
248 } | 248 } |
249 | 249 |
250 virtual bool ShouldCaptureFrame(base::TimeTicks present_time, | 250 virtual bool ShouldCaptureFrame(const gfx::Rect& damage_rect, |
| 251 base::TimeTicks present_time, |
251 scoped_refptr<media::VideoFrame>* storage, | 252 scoped_refptr<media::VideoFrame>* storage, |
252 DeliverFrameCallback* callback) OVERRIDE { | 253 DeliverFrameCallback* callback) OVERRIDE { |
253 // Only allow one frame capture to be made. Otherwise, the compositor could | 254 // Only allow one frame capture to be made. Otherwise, the compositor could |
254 // start multiple captures, unbounded, and eventually its own limiter logic | 255 // start multiple captures, unbounded, and eventually its own limiter logic |
255 // will begin invoking |callback| with a |false| result. This flakes out | 256 // will begin invoking |callback| with a |false| result. This flakes out |
256 // the unit tests, since they receive a "failed" callback before the later | 257 // the unit tests, since they receive a "failed" callback before the later |
257 // "success" callbacks. | 258 // "success" callbacks. |
258 if (callback_.is_null()) | 259 if (callback_.is_null()) |
259 return false; | 260 return false; |
260 *storage = media::VideoFrame::CreateBlackFrame(gfx::Size(100, 100)); | 261 *storage = media::VideoFrame::CreateBlackFrame(gfx::Size(100, 100)); |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 CompositingRenderWidgetHostViewBrowserTestTabCapture, | 854 CompositingRenderWidgetHostViewBrowserTestTabCapture, |
854 testing::ValuesIn(kAllCompositingModes)); | 855 testing::ValuesIn(kAllCompositingModes)); |
855 INSTANTIATE_TEST_CASE_P(GLAndSoftwareCompositing, | 856 INSTANTIATE_TEST_CASE_P(GLAndSoftwareCompositing, |
856 CompositingRenderWidgetHostViewTabCaptureHighDPI, | 857 CompositingRenderWidgetHostViewTabCaptureHighDPI, |
857 testing::ValuesIn(kAllCompositingModes)); | 858 testing::ValuesIn(kAllCompositingModes)); |
858 | 859 |
859 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 860 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
860 | 861 |
861 } // namespace | 862 } // namespace |
862 } // namespace content | 863 } // namespace content |
OLD | NEW |