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

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
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 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1345 GtkAllocation* allocation) { 1345 GtkAllocation* allocation) {
1346 // See comment next to size_ as to why we do this. Also note, it's tempting 1346 // See comment next to size_ as to why we do this. Also note, it's tempting
1347 // to put this in the static method so subclasses don't need to worry about 1347 // to put this in the static method so subclasses don't need to worry about
1348 // it, but if a subclasses needs to set a shape then they need to always 1348 // it, but if a subclasses needs to set a shape then they need to always
1349 // reset the shape in this method regardless of whether the size changed. 1349 // reset the shape in this method regardless of whether the size changed.
1350 gfx::Size new_size(allocation->width, allocation->height); 1350 gfx::Size new_size(allocation->width, allocation->height);
1351 if (new_size == size_) 1351 if (new_size == size_)
1352 return; 1352 return;
1353 size_ = new_size; 1353 size_ = new_size;
1354 if (compositor_.get()) 1354 if (compositor_.get())
1355 compositor_->OnWidgetSizeChanged(size_); 1355 compositor_->WidgetSizeChanged(size_);
1356 delegate_->OnNativeWidgetSizeChanged(size_); 1356 delegate_->OnNativeWidgetSizeChanged(size_);
1357 1357
1358 if (GetWidget()->non_client_view()) { 1358 if (GetWidget()->non_client_view()) {
1359 // The Window's NonClientView may provide a custom shape for the Window. 1359 // The Window's NonClientView may provide a custom shape for the Window.
1360 gfx::Path window_mask; 1360 gfx::Path window_mask;
1361 GetWidget()->non_client_view()->GetWindowMask(gfx::Size(allocation->width, 1361 GetWidget()->non_client_view()->GetWindowMask(gfx::Size(allocation->width,
1362 allocation->height), 1362 allocation->height),
1363 &window_mask); 1363 &window_mask);
1364 GdkRegion* mask_region = window_mask.CreateNativeRegion(); 1364 GdkRegion* mask_region = window_mask.CreateNativeRegion();
1365 gdk_window_shape_combine_region(GetNativeView()->window, mask_region, 0, 0); 1365 gdk_window_shape_combine_region(GetNativeView()->window, mask_region, 0, 0);
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
2245 button_pressed = event->type == GDK_BUTTON_PRESS || 2245 button_pressed = event->type == GDK_BUTTON_PRESS ||
2246 event->type == GDK_2BUTTON_PRESS || 2246 event->type == GDK_2BUTTON_PRESS ||
2247 event->type == GDK_3BUTTON_PRESS; 2247 event->type == GDK_3BUTTON_PRESS;
2248 gdk_event_free(event); 2248 gdk_event_free(event);
2249 } 2249 }
2250 return button_pressed; 2250 return button_pressed;
2251 } 2251 }
2252 2252
2253 } // namespace internal 2253 } // namespace internal
2254 } // namespace views 2254 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698