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

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: Add Preferred format support for all functions. 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 15 matching lines...) Expand all
26 #include "cc/output/compositor_frame_ack.h" 26 #include "cc/output/compositor_frame_ack.h"
27 #include "content/browser/accessibility/accessibility_mode_helper.h" 27 #include "content/browser/accessibility/accessibility_mode_helper.h"
28 #include "content/browser/accessibility/browser_accessibility_state_impl.h" 28 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
29 #include "content/browser/gpu/compositor_util.h" 29 #include "content/browser/gpu/compositor_util.h"
30 #include "content/browser/gpu/gpu_process_host.h" 30 #include "content/browser/gpu/gpu_process_host.h"
31 #include "content/browser/gpu/gpu_process_host_ui_shim.h" 31 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
32 #include "content/browser/gpu/gpu_surface_tracker.h" 32 #include "content/browser/gpu/gpu_surface_tracker.h"
33 #include "content/browser/renderer_host/backing_store.h" 33 #include "content/browser/renderer_host/backing_store.h"
34 #include "content/browser/renderer_host/backing_store_manager.h" 34 #include "content/browser/renderer_host/backing_store_manager.h"
35 #include "content/browser/renderer_host/dip_util.h" 35 #include "content/browser/renderer_host/dip_util.h"
36 #include "content/browser/renderer_host/image_transport_factory_android.h"
piman 2014/03/10 18:27:20 nit: remove
sivag 2014/03/11 14:41:50 Done.
36 #include "content/browser/renderer_host/input/input_router_impl.h" 37 #include "content/browser/renderer_host/input/input_router_impl.h"
37 #include "content/browser/renderer_host/input/synthetic_gesture.h" 38 #include "content/browser/renderer_host/input/synthetic_gesture.h"
38 #include "content/browser/renderer_host/input/synthetic_gesture_controller.h" 39 #include "content/browser/renderer_host/input/synthetic_gesture_controller.h"
39 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" 40 #include "content/browser/renderer_host/input/synthetic_gesture_target.h"
40 #include "content/browser/renderer_host/input/timeout_monitor.h" 41 #include "content/browser/renderer_host/input/timeout_monitor.h"
41 #include "content/browser/renderer_host/overscroll_controller.h" 42 #include "content/browser/renderer_host/overscroll_controller.h"
42 #include "content/browser/renderer_host/render_process_host_impl.h" 43 #include "content/browser/renderer_host/render_process_host_impl.h"
43 #include "content/browser/renderer_host/render_view_host_impl.h" 44 #include "content/browser/renderer_host/render_view_host_impl.h"
44 #include "content/browser/renderer_host/render_widget_helper.h" 45 #include "content/browser/renderer_host/render_widget_helper.h"
45 #include "content/browser/renderer_host/render_widget_host_delegate.h" 46 #include "content/browser/renderer_host/render_widget_host_delegate.h"
46 #include "content/common/accessibility_messages.h" 47 #include "content/common/accessibility_messages.h"
47 #include "content/common/content_constants_internal.h" 48 #include "content/common/content_constants_internal.h"
49 #include "content/common/gpu/client/gl_helper.h"
piman 2014/03/10 18:27:20 nit: remove
sivag 2014/03/11 14:41:50 Done.
48 #include "content/common/gpu/gpu_messages.h" 50 #include "content/common/gpu/gpu_messages.h"
49 #include "content/common/input_messages.h" 51 #include "content/common/input_messages.h"
50 #include "content/common/view_messages.h" 52 #include "content/common/view_messages.h"
51 #include "content/port/browser/render_widget_host_view_port.h" 53 #include "content/port/browser/render_widget_host_view_port.h"
52 #include "content/public/browser/native_web_keyboard_event.h" 54 #include "content/public/browser/native_web_keyboard_event.h"
53 #include "content/public/browser/notification_service.h" 55 #include "content/public/browser/notification_service.h"
54 #include "content/public/browser/notification_types.h" 56 #include "content/public/browser/notification_types.h"
55 #include "content/public/browser/render_widget_host_iterator.h" 57 #include "content/public/browser/render_widget_host_iterator.h"
56 #include "content/public/browser/user_metrics.h" 58 #include "content/public/browser/user_metrics.h"
57 #include "content/public/common/content_constants.h" 59 #include "content/public/common/content_constants.h"
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 void RenderWidgetHostImpl::SetIsLoading(bool is_loading) { 713 void RenderWidgetHostImpl::SetIsLoading(bool is_loading) {
712 is_loading_ = is_loading; 714 is_loading_ = is_loading;
713 if (!view_) 715 if (!view_)
714 return; 716 return;
715 view_->SetIsLoading(is_loading); 717 view_->SetIsLoading(is_loading);
716 } 718 }
717 719
718 void RenderWidgetHostImpl::CopyFromBackingStore( 720 void RenderWidgetHostImpl::CopyFromBackingStore(
719 const gfx::Rect& src_subrect, 721 const gfx::Rect& src_subrect,
720 const gfx::Size& accelerated_dst_size, 722 const gfx::Size& accelerated_dst_size,
721 const base::Callback<void(bool, const SkBitmap&)>& callback) { 723 const base::Callback<void(bool, const SkBitmap&)>& callback,
724 const SkBitmap::Config& bitmap_config) {
722 if (view_ && is_accelerated_compositing_active_) { 725 if (view_ && is_accelerated_compositing_active_) {
723 TRACE_EVENT0("browser", 726 TRACE_EVENT0("browser",
724 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface"); 727 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface");
725 gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ? 728 gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ?
726 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; 729 gfx::Rect(view_->GetViewBounds().size()) : src_subrect;
727 view_->CopyFromCompositingSurface(accelerated_copy_rect, 730 view_->CopyFromCompositingSurface(
728 accelerated_dst_size, 731 accelerated_copy_rect, accelerated_dst_size, callback, bitmap_config);
729 callback,
730 SkBitmap::kARGB_8888_Config);
731 return; 732 return;
732 } 733 }
733 734
734 BackingStore* backing_store = GetBackingStore(false); 735 BackingStore* backing_store = GetBackingStore(false);
735 if (!backing_store) { 736 if (!backing_store) {
736 callback.Run(false, SkBitmap()); 737 callback.Run(false, SkBitmap());
737 return; 738 return;
738 } 739 }
739 740
740 TRACE_EVENT0("browser", 741 TRACE_EVENT0("browser",
(...skipping 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after
2525 ++lc; 2526 ++lc;
2526 } 2527 }
2527 } 2528 }
2528 2529
2529 // Add newly generated components into the latency info 2530 // Add newly generated components into the latency info
2530 for (lc = new_components.begin(); lc != new_components.end(); ++lc) { 2531 for (lc = new_components.begin(); lc != new_components.end(); ++lc) {
2531 latency_info->latency_components[lc->first] = lc->second; 2532 latency_info->latency_components[lc->first] = lc->second;
2532 } 2533 }
2533 } 2534 }
2534 2535
2536 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() {
2537 if (view_)
2538 return view_->PreferredReadbackFormat();
2539 return SkBitmap::kARGB_8888_Config;
2540 }
2541
2535 } // namespace content 2542 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698