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

Side by Side Diff: views/widget/native_widget_gtk.cc

Issue 7552039: Vend common GL context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address reviewer comments. Created 9 years, 3 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
« no previous file with comments | « views/view_unittest.cc ('k') | views/widget/native_widget_win.cc » ('j') | 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 "views/widget/native_widget_gtk.h" 5 #include "views/widget/native_widget_gtk.h"
6 6
7 #include <gdk/gdk.h> 7 #include <gdk/gdk.h>
8 #include <gdk/gdkx.h> 8 #include <gdk/gdkx.h>
9 #include <X11/extensions/shape.h> 9 #include <X11/extensions/shape.h>
10 #include <X11/Xatom.h> 10 #include <X11/Xatom.h>
(...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 GtkAllocation* allocation) { 1343 GtkAllocation* allocation) {
1344 // See comment next to size_ as to why we do this. Also note, it's tempting 1344 // See comment next to size_ as to why we do this. Also note, it's tempting
1345 // to put this in the static method so subclasses don't need to worry about 1345 // to put this in the static method so subclasses don't need to worry about
1346 // it, but if a subclasses needs to set a shape then they need to always 1346 // it, but if a subclasses needs to set a shape then they need to always
1347 // reset the shape in this method regardless of whether the size changed. 1347 // reset the shape in this method regardless of whether the size changed.
1348 gfx::Size new_size(allocation->width, allocation->height); 1348 gfx::Size new_size(allocation->width, allocation->height);
1349 if (new_size == size_) 1349 if (new_size == size_)
1350 return; 1350 return;
1351 size_ = new_size; 1351 size_ = new_size;
1352 if (compositor_.get()) 1352 if (compositor_.get())
1353 compositor_->OnWidgetSizeChanged(size_); 1353 compositor_->WidgetSizeChanged(size_);
1354 delegate_->OnNativeWidgetSizeChanged(size_); 1354 delegate_->OnNativeWidgetSizeChanged(size_);
1355 1355
1356 if (GetWidget()->non_client_view()) { 1356 if (GetWidget()->non_client_view()) {
1357 // The Window's NonClientView may provide a custom shape for the Window. 1357 // The Window's NonClientView may provide a custom shape for the Window.
1358 gfx::Path window_mask; 1358 gfx::Path window_mask;
1359 GetWidget()->non_client_view()->GetWindowMask(gfx::Size(allocation->width, 1359 GetWidget()->non_client_view()->GetWindowMask(gfx::Size(allocation->width,
1360 allocation->height), 1360 allocation->height),
1361 &window_mask); 1361 &window_mask);
1362 GdkRegion* mask_region = window_mask.CreateNativeRegion(); 1362 GdkRegion* mask_region = window_mask.CreateNativeRegion();
1363 gdk_window_shape_combine_region(GetNativeView()->window, mask_region, 0, 0); 1363 gdk_window_shape_combine_region(GetNativeView()->window, mask_region, 0, 0);
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
2243 button_pressed = event->type == GDK_BUTTON_PRESS || 2243 button_pressed = event->type == GDK_BUTTON_PRESS ||
2244 event->type == GDK_2BUTTON_PRESS || 2244 event->type == GDK_2BUTTON_PRESS ||
2245 event->type == GDK_3BUTTON_PRESS; 2245 event->type == GDK_3BUTTON_PRESS;
2246 gdk_event_free(event); 2246 gdk_event_free(event);
2247 } 2247 }
2248 return button_pressed; 2248 return button_pressed;
2249 } 2249 }
2250 2250
2251 } // namespace internal 2251 } // namespace internal
2252 } // namespace views 2252 } // namespace views
OLDNEW
« no previous file with comments | « views/view_unittest.cc ('k') | views/widget/native_widget_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698