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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 is_loading_ = is_loading; | 671 is_loading_ = is_loading; |
672 if (!view_) | 672 if (!view_) |
673 return; | 673 return; |
674 view_->SetIsLoading(is_loading); | 674 view_->SetIsLoading(is_loading); |
675 } | 675 } |
676 | 676 |
677 void RenderWidgetHostImpl::CopyFromBackingStore( | 677 void RenderWidgetHostImpl::CopyFromBackingStore( |
678 const gfx::Rect& src_subrect, | 678 const gfx::Rect& src_subrect, |
679 const gfx::Size& accelerated_dst_size, | 679 const gfx::Size& accelerated_dst_size, |
680 const base::Callback<void(bool, const SkBitmap&)>& callback, | 680 const base::Callback<void(bool, const SkBitmap&)>& callback, |
681 const SkBitmap::Config& bitmap_config) { | 681 const SkColorType color_type) { |
682 if (view_) { | 682 if (view_) { |
683 TRACE_EVENT0("browser", | 683 TRACE_EVENT0("browser", |
684 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface"); | 684 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface"); |
685 gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ? | 685 gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ? |
686 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; | 686 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; |
687 view_->CopyFromCompositingSurface( | 687 view_->CopyFromCompositingSurface( |
688 accelerated_copy_rect, accelerated_dst_size, callback, bitmap_config); | 688 accelerated_copy_rect, accelerated_dst_size, callback, color_type); |
689 return; | 689 return; |
690 } | 690 } |
691 | 691 |
692 callback.Run(false, SkBitmap()); | 692 callback.Run(false, SkBitmap()); |
693 } | 693 } |
694 | 694 |
695 bool RenderWidgetHostImpl::CanCopyFromBackingStore() { | 695 bool RenderWidgetHostImpl::CanCopyFromBackingStore() { |
696 if (view_) | 696 if (view_) |
697 return view_->IsSurfaceAvailableForCopy(); | 697 return view_->IsSurfaceAvailableForCopy(); |
698 return false; | 698 return false; |
(...skipping 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2374 ++lc; | 2374 ++lc; |
2375 } | 2375 } |
2376 } | 2376 } |
2377 | 2377 |
2378 // Add newly generated components into the latency info | 2378 // Add newly generated components into the latency info |
2379 for (lc = new_components.begin(); lc != new_components.end(); ++lc) { | 2379 for (lc = new_components.begin(); lc != new_components.end(); ++lc) { |
2380 latency_info->latency_components[lc->first] = lc->second; | 2380 latency_info->latency_components[lc->first] = lc->second; |
2381 } | 2381 } |
2382 } | 2382 } |
2383 | 2383 |
2384 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { | 2384 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { |
2385 if (view_) | 2385 if (view_) |
2386 return view_->PreferredReadbackFormat(); | 2386 return view_->PreferredReadbackFormat(); |
2387 return SkBitmap::kARGB_8888_Config; | 2387 return kN32_SkColorType; |
2388 } | 2388 } |
2389 | 2389 |
2390 } // namespace content | 2390 } // namespace content |
OLD | NEW |