| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/browser/media/capture/web_contents_video_capture_device.h" | 5 #include "content/browser/media/capture/web_contents_video_capture_device.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 yuv_color_(kDrawColorNotSet) {} | 110 yuv_color_(kDrawColorNotSet) {} |
| 111 | 111 |
| 112 ~CaptureTestView() override {} | 112 ~CaptureTestView() override {} |
| 113 | 113 |
| 114 // TestRenderWidgetHostView overrides. | 114 // TestRenderWidgetHostView overrides. |
| 115 gfx::Rect GetViewBounds() const override { | 115 gfx::Rect GetViewBounds() const override { |
| 116 return fake_bounds_; | 116 return fake_bounds_; |
| 117 } | 117 } |
| 118 | 118 |
| 119 void SetSize(const gfx::Size& size) override { | 119 void SetSize(const gfx::Size& size) override { |
| 120 SetBounds(gfx::Rect(fake_bounds_.origin(), size)); | 120 RequestTopLevelBoundsInScreen(gfx::Rect(fake_bounds_.origin(), size)); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void SetBounds(const gfx::Rect& rect) override { | 123 void RequestTopLevelBoundsInScreen(const gfx::Rect& rect) override { |
| 124 fake_bounds_ = rect; | 124 fake_bounds_ = rect; |
| 125 } | 125 } |
| 126 | 126 |
| 127 bool CanCopyToVideoFrame() const override { return true; } | 127 bool CanCopyToVideoFrame() const override { return true; } |
| 128 | 128 |
| 129 void CopyFromCompositingSurfaceToVideoFrame( | 129 void CopyFromCompositingSurfaceToVideoFrame( |
| 130 const gfx::Rect& src_subrect, | 130 const gfx::Rect& src_subrect, |
| 131 const scoped_refptr<media::VideoFrame>& target, | 131 const scoped_refptr<media::VideoFrame>& target, |
| 132 const base::Callback<void(const gfx::Rect&, bool)>& callback) override { | 132 const base::Callback<void(const gfx::Rect&, bool)>& callback) override { |
| 133 media::FillYUV(target.get(), SkColorGetR(yuv_color_), | 133 media::FillYUV(target.get(), SkColorGetR(yuv_color_), |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 for (int i = 0; i < 3; ++i) { | 1009 for (int i = 0; i < 3; ++i) { |
| 1010 SimulateRefreshFrameRequest(); | 1010 SimulateRefreshFrameRequest(); |
| 1011 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); | 1011 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); |
| 1012 } | 1012 } |
| 1013 | 1013 |
| 1014 device()->StopAndDeAllocate(); | 1014 device()->StopAndDeAllocate(); |
| 1015 } | 1015 } |
| 1016 | 1016 |
| 1017 } // namespace | 1017 } // namespace |
| 1018 } // namespace content | 1018 } // namespace content |
| OLD | NEW |