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

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

Issue 10811002: Add threaded compositing mode to field trial (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ilya feedback Created 8 years, 5 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 | Annotate | Revision Log
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 <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/debug/trace_event.h" 12 #include "base/debug/trace_event.h"
13 #include "base/i18n/rtl.h" 13 #include "base/i18n/rtl.h"
14 #include "base/message_loop.h" 14 #include "base/message_loop.h"
15 #include "base/metrics/field_trial.h"
15 #include "base/metrics/histogram.h" 16 #include "base/metrics/histogram.h"
16 #include "base/string_number_conversions.h" 17 #include "base/string_number_conversions.h"
17 #include "base/utf_string_conversions.h" 18 #include "base/utf_string_conversions.h"
18 #include "content/browser/gpu/gpu_process_host.h" 19 #include "content/browser/gpu/gpu_process_host.h"
19 #include "content/browser/gpu/gpu_process_host_ui_shim.h" 20 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
20 #include "content/browser/gpu/gpu_surface_tracker.h" 21 #include "content/browser/gpu/gpu_surface_tracker.h"
21 #include "content/browser/renderer_host/backing_store.h" 22 #include "content/browser/renderer_host/backing_store.h"
22 #include "content/browser/renderer_host/backing_store_manager.h" 23 #include "content/browser/renderer_host/backing_store_manager.h"
23 #include "content/browser/renderer_host/render_process_host_impl.h" 24 #include "content/browser/renderer_host/render_process_host_impl.h"
24 #include "content/browser/renderer_host/render_view_host_impl.h" 25 #include "content/browser/renderer_host/render_view_host_impl.h"
25 #include "content/browser/renderer_host/render_widget_helper.h" 26 #include "content/browser/renderer_host/render_widget_helper.h"
26 #include "content/browser/renderer_host/render_widget_host_delegate.h" 27 #include "content/browser/renderer_host/render_widget_host_delegate.h"
27 #include "content/browser/renderer_host/tap_suppression_controller.h" 28 #include "content/browser/renderer_host/tap_suppression_controller.h"
28 #include "content/common/accessibility_messages.h" 29 #include "content/common/accessibility_messages.h"
29 #include "content/common/gpu/gpu_messages.h" 30 #include "content/common/gpu/gpu_messages.h"
30 #include "content/common/view_messages.h" 31 #include "content/common/view_messages.h"
31 #include "content/port/browser/render_widget_host_view_port.h" 32 #include "content/port/browser/render_widget_host_view_port.h"
32 #include "content/port/browser/smooth_scroll_gesture.h" 33 #include "content/port/browser/smooth_scroll_gesture.h"
33 #include "content/public/browser/native_web_keyboard_event.h" 34 #include "content/public/browser/native_web_keyboard_event.h"
34 #include "content/public/browser/notification_service.h" 35 #include "content/public/browser/notification_service.h"
35 #include "content/public/browser/notification_types.h" 36 #include "content/public/browser/notification_types.h"
36 #include "content/public/browser/user_metrics.h" 37 #include "content/public/browser/user_metrics.h"
38 #include "content/public/common/content_constants.h"
37 #include "content/public/common/content_switches.h" 39 #include "content/public/common/content_switches.h"
38 #include "content/public/common/result_codes.h" 40 #include "content/public/common/result_codes.h"
39 #include "skia/ext/image_operations.h" 41 #include "skia/ext/image_operations.h"
40 #include "skia/ext/platform_canvas.h" 42 #include "skia/ext/platform_canvas.h"
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h" 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h"
42 #if defined(OS_WIN) 44 #if defined(OS_WIN)
43 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebScreenInfoFact ory.h" 45 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebScreenInfoFact ory.h"
44 #endif 46 #endif
45 #include "ui/base/keycodes/keyboard_codes.h" 47 #include "ui/base/keycodes/keyboard_codes.h"
46 #include "ui/gfx/skbitmap_operations.h" 48 #include "ui/gfx/skbitmap_operations.h"
(...skipping 1839 matching lines...) Expand 10 before | Expand all | Expand 10 after
1886 // static 1888 // static
1887 void RenderWidgetHostImpl::AcknowledgeBufferPresent( 1889 void RenderWidgetHostImpl::AcknowledgeBufferPresent(
1888 int32 route_id, int gpu_host_id, uint32 sync_point) { 1890 int32 route_id, int gpu_host_id, uint32 sync_point) {
1889 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id); 1891 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id);
1890 if (ui_shim) 1892 if (ui_shim)
1891 ui_shim->Send(new AcceleratedSurfaceMsg_BufferPresented(route_id, 1893 ui_shim->Send(new AcceleratedSurfaceMsg_BufferPresented(route_id,
1892 sync_point)); 1894 sync_point));
1893 } 1895 }
1894 1896
1895 void RenderWidgetHostImpl::AcknowledgeSwapBuffersToRenderer() { 1897 void RenderWidgetHostImpl::AcknowledgeSwapBuffersToRenderer() {
1898 base::FieldTrial* trial =
1899 base::FieldTrialList::Find(content::kGpuCompositingFieldTrialName);
1900 bool is_thread_trial = trial && trial->group_name() ==
1901 content::kGpuCompositingFieldTrialThreadEnabledName;
1902 bool has_enable = CommandLine::ForCurrentProcess()->HasSwitch(
1903 switches::kEnableThreadedCompositing);
1904 bool has_disable = CommandLine::ForCurrentProcess()->HasSwitch(
1905 switches::kDisableThreadedCompositing);
1906 DCHECK(!is_thread_trial || !has_disable);
1896 bool enable_threaded_compositing = 1907 bool enable_threaded_compositing =
1897 CommandLine::ForCurrentProcess()->HasSwitch( 1908 is_thread_trial || (has_enable && !has_disable);
1898 switches::kEnableThreadedCompositing) &&
1899 !CommandLine::ForCurrentProcess()->HasSwitch(
1900 switches::kDisableThreadedCompositing);
1901 if (!enable_threaded_compositing) 1909 if (!enable_threaded_compositing)
1902 Send(new ViewMsg_SwapBuffers_ACK(routing_id_)); 1910 Send(new ViewMsg_SwapBuffers_ACK(routing_id_));
1903 } 1911 }
1904 1912
1905 void RenderWidgetHostImpl::DelayedAutoResized() { 1913 void RenderWidgetHostImpl::DelayedAutoResized() {
1906 gfx::Size new_size = new_auto_size_; 1914 gfx::Size new_size = new_auto_size_;
1907 // Clear the new_auto_size_ since the empty value is used as a flag to 1915 // Clear the new_auto_size_ since the empty value is used as a flag to
1908 // indicate that no callback is in progress (i.e. without this line 1916 // indicate that no callback is in progress (i.e. without this line
1909 // DelayedAutoResized will not get called again). 1917 // DelayedAutoResized will not get called again).
1910 new_auto_size_.SetSize(0, 0); 1918 new_auto_size_.SetSize(0, 0);
1911 if (!should_auto_resize_) 1919 if (!should_auto_resize_)
1912 return; 1920 return;
1913 1921
1914 OnRenderAutoResized(new_size); 1922 OnRenderAutoResized(new_size);
1915 } 1923 }
1916 1924
1917 } // namespace content 1925 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/gpu_util.cc ('k') | content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698