| 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 "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/debug/debugger.h" | 8 #include "base/debug/debugger.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // our special subclass which has mocked-out tab capture support. | 241 // our special subclass which has mocked-out tab capture support. |
| 242 RenderWidgetHostView* old_view = GetView(); | 242 RenderWidgetHostView* old_view = GetView(); |
| 243 SetView(new CaptureTestView(this, controller)); | 243 SetView(new CaptureTestView(this, controller)); |
| 244 delete old_view; | 244 delete old_view; |
| 245 } | 245 } |
| 246 | 246 |
| 247 // TestRenderViewHost overrides. | 247 // TestRenderViewHost overrides. |
| 248 virtual void CopyFromBackingStore( | 248 virtual void CopyFromBackingStore( |
| 249 const gfx::Rect& src_rect, | 249 const gfx::Rect& src_rect, |
| 250 const gfx::Size& accelerated_dst_size, | 250 const gfx::Size& accelerated_dst_size, |
| 251 const base::Callback<void(bool, const SkBitmap&)>& callback) OVERRIDE { | 251 const base::Callback<void(bool, const SkBitmap&)>& callback, |
| 252 const SkBitmap::Config& bitmap_config) OVERRIDE { |
| 252 gfx::Size size = controller_->GetCopyResultSize(); | 253 gfx::Size size = controller_->GetCopyResultSize(); |
| 253 SkColor color = controller_->GetSolidColor(); | 254 SkColor color = controller_->GetSolidColor(); |
| 254 | 255 |
| 255 // Although it's not necessary, use a PlatformBitmap here (instead of a | 256 // Although it's not necessary, use a PlatformBitmap here (instead of a |
| 256 // regular SkBitmap) to exercise possible threading issues. | 257 // regular SkBitmap) to exercise possible threading issues. |
| 257 skia::PlatformBitmap output; | 258 skia::PlatformBitmap output; |
| 258 EXPECT_TRUE(output.Allocate(size.width(), size.height(), false)); | 259 EXPECT_TRUE(output.Allocate(size.width(), size.height(), false)); |
| 259 { | 260 { |
| 260 SkAutoLockPixels locker(output.GetBitmap()); | 261 SkAutoLockPixels locker(output.GetBitmap()); |
| 261 output.GetBitmap().eraseColor(color); | 262 output.GetBitmap().eraseColor(color); |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 source()->SetSolidColor(SK_ColorGREEN); | 806 source()->SetSolidColor(SK_ColorGREEN); |
| 806 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); | 807 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); |
| 807 source()->SetSolidColor(SK_ColorRED); | 808 source()->SetSolidColor(SK_ColorRED); |
| 808 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorRED)); | 809 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorRED)); |
| 809 | 810 |
| 810 device()->StopAndDeAllocate(); | 811 device()->StopAndDeAllocate(); |
| 811 } | 812 } |
| 812 | 813 |
| 813 } // namespace | 814 } // namespace |
| 814 } // namespace content | 815 } // namespace content |
| OLD | NEW |