| 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/renderer_host/render_widget_host_view_win.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
| 6 | 6 |
| 7 #include <InputScope.h> | 7 #include <InputScope.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 const base::Callback<void(bool, const SkBitmap&)>& callback) { | 819 const base::Callback<void(bool, const SkBitmap&)>& callback) { |
| 820 base::ScopedClosureRunner scoped_callback_runner( | 820 base::ScopedClosureRunner scoped_callback_runner( |
| 821 base::Bind(callback, false, SkBitmap())); | 821 base::Bind(callback, false, SkBitmap())); |
| 822 if (!accelerated_surface_.get()) | 822 if (!accelerated_surface_.get()) |
| 823 return; | 823 return; |
| 824 | 824 |
| 825 if (dst_size.IsEmpty()) | 825 if (dst_size.IsEmpty()) |
| 826 return; | 826 return; |
| 827 | 827 |
| 828 scoped_callback_runner.Release(); | 828 scoped_callback_runner.Release(); |
| 829 accelerated_surface_->AsyncCopyTo( | 829 accelerated_surface_->AsyncCopyTo(src_subrect, dst_size, callback); |
| 830 src_subrect, | 830 } |
| 831 dst_size, | 831 |
| 832 callback); | 832 void RenderWidgetHostViewWin::CopyFromCompositingSurfaceToVideoFrame( |
| 833 const gfx::Rect& src_subrect, |
| 834 const scoped_refptr<media::VideoFrame>& target, |
| 835 const base::Callback<void(bool)>& callback) { |
| 836 base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false)); |
| 837 if (!accelerated_surface_.get()) |
| 838 return; |
| 839 |
| 840 if (!target || target->format() != media::VideoFrame::YV12) |
| 841 return; |
| 842 |
| 843 scoped_callback_runner.Release(); |
| 844 accelerated_surface_->AsyncCopyToVideoFrame(src_subrect, target, callback); |
| 833 } | 845 } |
| 834 | 846 |
| 835 void RenderWidgetHostViewWin::SetBackground(const SkBitmap& background) { | 847 void RenderWidgetHostViewWin::SetBackground(const SkBitmap& background) { |
| 836 RenderWidgetHostViewBase::SetBackground(background); | 848 RenderWidgetHostViewBase::SetBackground(background); |
| 837 render_widget_host_->SetBackground(background); | 849 render_widget_host_->SetBackground(background); |
| 838 } | 850 } |
| 839 | 851 |
| 840 void RenderWidgetHostViewWin::ProcessAckedTouchEvent( | 852 void RenderWidgetHostViewWin::ProcessAckedTouchEvent( |
| 841 const WebKit::WebTouchEvent& touch, InputEventAckState ack_result) { | 853 const WebKit::WebTouchEvent& touch, InputEventAckState ack_result) { |
| 842 DCHECK(touch_events_enabled_); | 854 DCHECK(touch_events_enabled_); |
| (...skipping 2227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3070 return new RenderWidgetHostViewWin(widget); | 3082 return new RenderWidgetHostViewWin(widget); |
| 3071 } | 3083 } |
| 3072 | 3084 |
| 3073 // static | 3085 // static |
| 3074 void RenderWidgetHostViewPort::GetDefaultScreenInfo( | 3086 void RenderWidgetHostViewPort::GetDefaultScreenInfo( |
| 3075 WebKit::WebScreenInfo* results) { | 3087 WebKit::WebScreenInfo* results) { |
| 3076 GetScreenInfoForWindow(results, 0); | 3088 GetScreenInfoForWindow(results, 0); |
| 3077 } | 3089 } |
| 3078 | 3090 |
| 3079 } // namespace content | 3091 } // namespace content |
| OLD | NEW |