Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(682)

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 188633002: Query the preferred readback config in CopyFromBackingStore (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for test build issue. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 void RenderWidgetHostImpl::SetIsLoading(bool is_loading) { 711 void RenderWidgetHostImpl::SetIsLoading(bool is_loading) {
712 is_loading_ = is_loading; 712 is_loading_ = is_loading;
713 if (!view_) 713 if (!view_)
714 return; 714 return;
715 view_->SetIsLoading(is_loading); 715 view_->SetIsLoading(is_loading);
716 } 716 }
717 717
718 void RenderWidgetHostImpl::CopyFromBackingStore( 718 void RenderWidgetHostImpl::CopyFromBackingStore(
719 const gfx::Rect& src_subrect, 719 const gfx::Rect& src_subrect,
720 const gfx::Size& accelerated_dst_size, 720 const gfx::Size& accelerated_dst_size,
721 const base::Callback<void(bool, const SkBitmap&)>& callback) { 721 const base::Callback<void(bool, const SkBitmap&)>& callback,
722 const SkBitmap::Config& bitmap_config) {
722 if (view_ && is_accelerated_compositing_active_) { 723 if (view_ && is_accelerated_compositing_active_) {
723 TRACE_EVENT0("browser", 724 TRACE_EVENT0("browser",
724 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface"); 725 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface");
725 gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ? 726 gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ?
726 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; 727 gfx::Rect(view_->GetViewBounds().size()) : src_subrect;
727 view_->CopyFromCompositingSurface(accelerated_copy_rect, 728 view_->CopyFromCompositingSurface(
728 accelerated_dst_size, 729 accelerated_copy_rect, accelerated_dst_size, callback, bitmap_config);
729 callback,
730 SkBitmap::kARGB_8888_Config);
731 return; 730 return;
732 } 731 }
733 732
734 BackingStore* backing_store = GetBackingStore(false); 733 BackingStore* backing_store = GetBackingStore(false);
735 if (!backing_store) { 734 if (!backing_store) {
736 callback.Run(false, SkBitmap()); 735 callback.Run(false, SkBitmap());
737 return; 736 return;
738 } 737 }
739 738
740 TRACE_EVENT0("browser", 739 TRACE_EVENT0("browser",
(...skipping 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after
2525 ++lc; 2524 ++lc;
2526 } 2525 }
2527 } 2526 }
2528 2527
2529 // Add newly generated components into the latency info 2528 // Add newly generated components into the latency info
2530 for (lc = new_components.begin(); lc != new_components.end(); ++lc) { 2529 for (lc = new_components.begin(); lc != new_components.end(); ++lc) {
2531 latency_info->latency_components[lc->first] = lc->second; 2530 latency_info->latency_components[lc->first] = lc->second;
2532 } 2531 }
2533 } 2532 }
2534 2533
2534 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() {
2535 if (view_)
2536 return view_->PreferredReadbackFormat();
2537 return SkBitmap::kARGB_8888_Config;
2538 }
2539
2535 } // namespace content 2540 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698