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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 8595002: Get rid of gpu_messages.h include in chrome by having the RenderWidgetHostView implementation ask... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix aura/views build Created 9 years, 1 month 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_view_mac.h" 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h"
6 6
7 #include <QuartzCore/QuartzCore.h> 7 #include <QuartzCore/QuartzCore.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/mac/mac_util.h" 12 #include "base/mac/mac_util.h"
13 #include "base/mac/scoped_cftyperef.h" 13 #include "base/mac/scoped_cftyperef.h"
14 #import "base/mac/scoped_nsautorelease_pool.h" 14 #import "base/mac/scoped_nsautorelease_pool.h"
15 #import "base/memory/scoped_nsobject.h" 15 #import "base/memory/scoped_nsobject.h"
16 #include "base/metrics/histogram.h" 16 #include "base/metrics/histogram.h"
17 #include "base/string_util.h" 17 #include "base/string_util.h"
18 #include "base/sys_info.h" 18 #include "base/sys_info.h"
19 #include "base/sys_string_conversions.h" 19 #include "base/sys_string_conversions.h"
20 #include "base/utf_string_conversions.h" 20 #include "base/utf_string_conversions.h"
21 #import "content/browser/accessibility/browser_accessibility_cocoa.h" 21 #import "content/browser/accessibility/browser_accessibility_cocoa.h"
22 #include "content/browser/gpu/gpu_process_host.h"
23 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
24 #include "content/browser/mac/closure_blocks_leopard_compat.h" 22 #include "content/browser/mac/closure_blocks_leopard_compat.h"
25 #include "content/browser/plugin_process_host.h" 23 #include "content/browser/plugin_process_host.h"
26 #import "content/browser/renderer_host/accelerated_plugin_view_mac.h" 24 #import "content/browser/renderer_host/accelerated_plugin_view_mac.h"
27 #include "content/browser/renderer_host/backing_store_mac.h" 25 #include "content/browser/renderer_host/backing_store_mac.h"
28 #include "content/browser/renderer_host/render_process_host_impl.h" 26 #include "content/browser/renderer_host/render_process_host_impl.h"
29 #include "content/browser/renderer_host/render_view_host.h" 27 #include "content/browser/renderer_host/render_view_host.h"
30 #import "content/browser/renderer_host/render_widget_host_view_mac_delegate.h" 28 #import "content/browser/renderer_host/render_widget_host_view_mac_delegate.h"
31 #import "content/browser/renderer_host/render_widget_host_view_mac_editcommand_h elper.h" 29 #import "content/browser/renderer_host/render_widget_host_view_mac_editcommand_h elper.h"
32 #import "content/browser/renderer_host/text_input_client_mac.h" 30 #import "content/browser/renderer_host/text_input_client_mac.h"
33 #include "content/common/edit_command.h" 31 #include "content/common/edit_command.h"
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 // Called on the display link thread. Hand actual work off to the IO thread, 926 // Called on the display link thread. Hand actual work off to the IO thread,
929 // because |GpuProcessHost::Get()| can only be called there. 927 // because |GpuProcessHost::Get()| can only be called there.
930 // Currently, this is never called for plugins. 928 // Currently, this is never called for plugins.
931 if (render_widget_host_) { 929 if (render_widget_host_) {
932 DCHECK_EQ(render_widget_host_->process()->GetID(), renderer_id); 930 DCHECK_EQ(render_widget_host_->process()->GetID(), renderer_id);
933 // |render_widget_host_->routing_id()| and |route_id| are usually not 931 // |render_widget_host_->routing_id()| and |route_id| are usually not
934 // equal: The former identifies the channel from the RWH in the browser 932 // equal: The former identifies the channel from the RWH in the browser
935 // process to the corresponding render widget in the renderer process, while 933 // process to the corresponding render widget in the renderer process, while
936 // the latter identifies the channel from the GpuCommandBufferStub in the 934 // the latter identifies the channel from the GpuCommandBufferStub in the
937 // GPU process to the corresponding command buffer client in the renderer. 935 // GPU process to the corresponding command buffer client in the renderer.
938 } 936
939 937 render_widget_host_->AcknowledgeSwapBuffers(route_id, gpu_host_id);
940 // TODO(apatrick): Send the acknowledgement via the UI thread when running in
941 // single process or in process GPU mode for now. This is bad from a
942 // performance point of view but the plan is to not use AcceleratedSurface at
943 // all in these cases.
944 if (gpu_host_id == 0) {
945 BrowserThread::PostTask(
946 BrowserThread::UI,
947 FROM_HERE,
948 base::Bind(&GpuProcessHostUIShim::SendToGpuHost,
949 gpu_host_id,
950 new AcceleratedSurfaceMsg_BuffersSwappedACK(route_id)));
951 } else {
952 GpuProcessHost::SendOnIO(
953 gpu_host_id,
954 content::CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH,
955 new AcceleratedSurfaceMsg_BuffersSwappedACK(route_id));
956 } 938 }
957 } 939 }
958 940
959 void RenderWidgetHostViewMac::OnAcceleratedCompositingStateChange() { 941 void RenderWidgetHostViewMac::OnAcceleratedCompositingStateChange() {
960 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 942 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
961 bool activated = GetRenderWidgetHost()->is_accelerated_compositing_active(); 943 bool activated = GetRenderWidgetHost()->is_accelerated_compositing_active();
962 bool changed = accelerated_compositing_active_ != activated; 944 bool changed = accelerated_compositing_active_ != activated;
963 accelerated_compositing_active_ = activated; 945 accelerated_compositing_active_ = activated;
964 if (!changed) 946 if (!changed)
965 return; 947 return;
(...skipping 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after
2745 if (!string) return NO; 2727 if (!string) return NO;
2746 2728
2747 // If the user is currently using an IME, confirm the IME input, 2729 // If the user is currently using an IME, confirm the IME input,
2748 // and then insert the text from the service, the same as TextEdit and Safari. 2730 // and then insert the text from the service, the same as TextEdit and Safari.
2749 [self confirmComposition]; 2731 [self confirmComposition];
2750 [self insertText:string]; 2732 [self insertText:string];
2751 return YES; 2733 return YES;
2752 } 2734 }
2753 2735
2754 @end 2736 @end
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698