Chromium Code Reviews| 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 15 matching lines...) Expand all Loading... | |
| 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" | |
| 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" | |
| 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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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) { |
| 722 if (view_ && is_accelerated_compositing_active_) { | 724 if (view_ && is_accelerated_compositing_active_) { |
| 723 TRACE_EVENT0("browser", | 725 TRACE_EVENT0("browser", |
| 724 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface"); | 726 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface"); |
| 725 gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ? | 727 gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ? |
| 726 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; | 728 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; |
| 729 ImageTransportFactoryAndroid* factory = | |
| 730 ImageTransportFactoryAndroid::GetInstance(); | |
| 731 GLHelper* gl_helper = factory->GetGLHelper(); | |
| 732 SkBitmap::Config preffered_format = SkBitmap::kARGB_8888_Config; | |
| 733 DCHECK(gl_helper); | |
| 734 if (gl_helper) | |
| 735 preffered_format = gl_helper->PreferredReadbackFormat(); | |
|
piman
2014/03/06 22:01:52
This code is out-of-place.
1- Obviously we can't a
sivag
2014/03/10 15:48:18
Done.
| |
| 727 view_->CopyFromCompositingSurface(accelerated_copy_rect, | 736 view_->CopyFromCompositingSurface(accelerated_copy_rect, |
| 728 accelerated_dst_size, | 737 accelerated_dst_size, |
| 729 callback, | 738 callback, |
| 730 SkBitmap::kARGB_8888_Config); | 739 preffered_format); |
| 731 return; | 740 return; |
| 732 } | 741 } |
| 733 | 742 |
| 734 BackingStore* backing_store = GetBackingStore(false); | 743 BackingStore* backing_store = GetBackingStore(false); |
| 735 if (!backing_store) { | 744 if (!backing_store) { |
| 736 callback.Run(false, SkBitmap()); | 745 callback.Run(false, SkBitmap()); |
| 737 return; | 746 return; |
| 738 } | 747 } |
| 739 | 748 |
| 740 TRACE_EVENT0("browser", | 749 TRACE_EVENT0("browser", |
| (...skipping 1800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2541 } | 2550 } |
| 2542 } | 2551 } |
| 2543 | 2552 |
| 2544 // Add newly generated components into the latency info | 2553 // Add newly generated components into the latency info |
| 2545 for (lc = new_components.begin(); lc != new_components.end(); ++lc) { | 2554 for (lc = new_components.begin(); lc != new_components.end(); ++lc) { |
| 2546 latency_info->latency_components[lc->first] = lc->second; | 2555 latency_info->latency_components[lc->first] = lc->second; |
| 2547 } | 2556 } |
| 2548 } | 2557 } |
| 2549 | 2558 |
| 2550 } // namespace content | 2559 } // namespace content |
| OLD | NEW |