| 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_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 | 709 |
| 710 // TODO(evanm): tracking this may no longer be necessary; | 710 // TODO(evanm): tracking this may no longer be necessary; |
| 711 // eliminate this function if so. | 711 // eliminate this function if so. |
| 712 SetView(NULL); | 712 SetView(NULL); |
| 713 } | 713 } |
| 714 | 714 |
| 715 void RenderWidgetHostImpl::CopyFromBackingStore( | 715 void RenderWidgetHostImpl::CopyFromBackingStore( |
| 716 const gfx::Rect& src_subrect, | 716 const gfx::Rect& src_subrect, |
| 717 const gfx::Size& accelerated_dst_size, | 717 const gfx::Size& accelerated_dst_size, |
| 718 ReadbackRequestCallback& callback, | 718 ReadbackRequestCallback& callback, |
| 719 const SkColorType color_type) { | 719 const SkColorType preferred_color_type) { |
| 720 if (view_) { | 720 if (view_) { |
| 721 TRACE_EVENT0("browser", | 721 TRACE_EVENT0("browser", |
| 722 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface"); | 722 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface"); |
| 723 gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ? | 723 gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ? |
| 724 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; | 724 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; |
| 725 view_->CopyFromCompositingSurface( | 725 view_->CopyFromCompositingSurface(accelerated_copy_rect, |
| 726 accelerated_copy_rect, accelerated_dst_size, callback, color_type); | 726 accelerated_dst_size, callback, |
| 727 preferred_color_type); |
| 727 return; | 728 return; |
| 728 } | 729 } |
| 729 | 730 |
| 730 callback.Run(SkBitmap(), content::READBACK_FAILED); | 731 callback.Run(SkBitmap(), content::READBACK_FAILED); |
| 731 } | 732 } |
| 732 | 733 |
| 733 bool RenderWidgetHostImpl::CanCopyFromBackingStore() { | 734 bool RenderWidgetHostImpl::CanCopyFromBackingStore() { |
| 734 if (view_) | 735 if (view_) |
| 735 return view_->IsSurfaceAvailableForCopy(); | 736 return view_->IsSurfaceAvailableForCopy(); |
| 736 return false; | 737 return false; |
| (...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2114 return latency_tracker_.GetEstimatedBrowserCompositeTime(); | 2115 return latency_tracker_.GetEstimatedBrowserCompositeTime(); |
| 2115 } | 2116 } |
| 2116 | 2117 |
| 2117 #if defined(OS_WIN) | 2118 #if defined(OS_WIN) |
| 2118 gfx::NativeViewAccessible | 2119 gfx::NativeViewAccessible |
| 2119 RenderWidgetHostImpl::GetParentNativeViewAccessible() { | 2120 RenderWidgetHostImpl::GetParentNativeViewAccessible() { |
| 2120 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; | 2121 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; |
| 2121 } | 2122 } |
| 2122 #endif | 2123 #endif |
| 2123 | 2124 |
| 2124 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { | |
| 2125 if (view_) | |
| 2126 return view_->PreferredReadbackFormat(); | |
| 2127 return kN32_SkColorType; | |
| 2128 } | |
| 2129 | |
| 2130 } // namespace content | 2125 } // namespace content |
| OLD | NEW |