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

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

Issue 25795002: Move surface resize platform code from GpuProcessHostUIShim to RenderWidgetHostView implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 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_view_gtk.h" 5 #include "content/browser/renderer_host/render_widget_host_view_gtk.h"
6 6
7 #include <cairo/cairo.h> 7 #include <cairo/cairo.h>
8 #include <gdk/gdk.h> 8 #include <gdk/gdk.h>
9 #include <gdk/gdkkeysyms.h> 9 #include <gdk/gdkkeysyms.h>
10 #include <gdk/gdkx.h> 10 #include <gdk/gdkx.h>
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 GtkNativeViewManager* manager = GtkNativeViewManager::GetInstance(); 1287 GtkNativeViewManager* manager = GtkNativeViewManager::GetInstance();
1288 gfx::NativeViewId view_id = GetNativeViewId(); 1288 gfx::NativeViewId view_id = GetNativeViewId();
1289 1289
1290 if (!manager->GetPermanentXIDForId(&compositing_surface_, view_id)) { 1290 if (!manager->GetPermanentXIDForId(&compositing_surface_, view_id)) {
1291 DLOG(ERROR) << "Can't find XID for view id " << view_id; 1291 DLOG(ERROR) << "Can't find XID for view id " << view_id;
1292 } 1292 }
1293 } 1293 }
1294 return gfx::GLSurfaceHandle(compositing_surface_, gfx::NATIVE_TRANSPORT); 1294 return gfx::GLSurfaceHandle(compositing_surface_, gfx::NATIVE_TRANSPORT);
1295 } 1295 }
1296 1296
1297 void RenderWidgetHostViewGtk::ResizeCompositingSurface(const gfx::Size& size) {
1298 gfx::GLSurfaceHandle surface = GetCompositingSurface();
1299
1300 GdkWindow* window = reinterpret_cast<GdkWindow*>(
1301 gdk_xid_table_lookup(surface.handle));
piman 2013/10/03 00:17:29 This can probably be simplified now, by getting th
1302 if (window) {
1303 Display* display = GDK_WINDOW_XDISPLAY(window);
1304 gdk_window_resize(window, size.width(), size.height());
1305 XSync(display, False);
1306 }
1307 }
1308
1297 bool RenderWidgetHostViewGtk::LockMouse() { 1309 bool RenderWidgetHostViewGtk::LockMouse() {
1298 if (mouse_locked_) 1310 if (mouse_locked_)
1299 return true; 1311 return true;
1300 1312
1301 mouse_locked_ = true; 1313 mouse_locked_ = true;
1302 1314
1303 // Release any current grab. 1315 // Release any current grab.
1304 GtkWidget* current_grab_window = gtk_grab_get_current(); 1316 GtkWidget* current_grab_window = gtk_grab_get_current();
1305 if (current_grab_window) { 1317 if (current_grab_window) {
1306 gtk_grab_remove(current_grab_window); 1318 gtk_grab_remove(current_grab_window);
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 gfx::PluginWindowHandle id) { 1587 gfx::PluginWindowHandle id) {
1576 plugin_container_manager_.CreatePluginContainer(id); 1588 plugin_container_manager_.CreatePluginContainer(id);
1577 } 1589 }
1578 1590
1579 void RenderWidgetHostViewGtk::OnDestroyPluginContainer( 1591 void RenderWidgetHostViewGtk::OnDestroyPluginContainer(
1580 gfx::PluginWindowHandle id) { 1592 gfx::PluginWindowHandle id) {
1581 plugin_container_manager_.DestroyPluginContainer(id); 1593 plugin_container_manager_.DestroyPluginContainer(id);
1582 } 1594 }
1583 1595
1584 } // namespace content 1596 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698