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

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

Issue 6462034: Refactor how surfaces are acquired for GPU compositing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix view views build. Created 9 years, 10 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <QuartzCore/QuartzCore.h> 5 #include <QuartzCore/QuartzCore.h>
6 6
7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
8 8
9 #include "app/app_switches.h" 9 #include "app/app_switches.h"
10 #include "app/surface/io_surface_support_mac.h" 10 #include "app/surface/io_surface_support_mac.h"
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 void RenderWidgetHostViewMac::GpuRenderingStateDidChange() { 1198 void RenderWidgetHostViewMac::GpuRenderingStateDidChange() {
1199 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1199 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1200 if (GetRenderWidgetHost()->is_accelerated_compositing_active()) { 1200 if (GetRenderWidgetHost()->is_accelerated_compositing_active()) {
1201 UpdateRootGpuViewVisibility( 1201 UpdateRootGpuViewVisibility(
1202 GetRenderWidgetHost()->is_accelerated_compositing_active()); 1202 GetRenderWidgetHost()->is_accelerated_compositing_active());
1203 } else { 1203 } else {
1204 needs_gpu_visibility_update_after_repaint_ = true; 1204 needs_gpu_visibility_update_after_repaint_ = true;
1205 } 1205 }
1206 } 1206 }
1207 1207
1208 gfx::PluginWindowHandle RenderWidgetHostViewMac::AcquireCompositingSurface() {
1209 return AllocateFakePluginWindowHandle(/*opaque=*/true, /*root=*/true);
1210 }
1211
1212 void RenderWidgetHostViewMac::ReleaseCompositingSurface(
1213 gfx::PluginWindowHandle surface) {
1214 DestroyFakePluginWindowHandle(surface);
1215 }
1216
1208 void RenderWidgetHostViewMac::DrawAcceleratedSurfaceInstance( 1217 void RenderWidgetHostViewMac::DrawAcceleratedSurfaceInstance(
1209 CGLContextObj context, 1218 CGLContextObj context,
1210 gfx::PluginWindowHandle plugin_handle, 1219 gfx::PluginWindowHandle plugin_handle,
1211 NSSize size) { 1220 NSSize size) {
1212 // Called on the display link thread. 1221 // Called on the display link thread.
1213 CGLSetCurrentContext(context); 1222 CGLSetCurrentContext(context);
1214 1223
1215 glMatrixMode(GL_PROJECTION); 1224 glMatrixMode(GL_PROJECTION);
1216 glLoadIdentity(); 1225 glLoadIdentity();
1217 // Note that we place the origin at the upper left corner with +y 1226 // Note that we place the origin at the upper left corner with +y
(...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after
2831 if (!string) return NO; 2840 if (!string) return NO;
2832 2841
2833 // If the user is currently using an IME, confirm the IME input, 2842 // If the user is currently using an IME, confirm the IME input,
2834 // and then insert the text from the service, the same as TextEdit and Safari. 2843 // and then insert the text from the service, the same as TextEdit and Safari.
2835 [self confirmComposition]; 2844 [self confirmComposition];
2836 [self insertText:string]; 2845 [self insertText:string];
2837 return YES; 2846 return YES;
2838 } 2847 }
2839 2848
2840 @end 2849 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698