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

Side by Side Diff: base/gfx/gtk_util.cc

Issue 53104: Make it more obvious when our backing store has failed us. (Closed)
Patch Set: seafoam green Created 11 years, 9 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
« no previous file with comments | « base/gfx/gtk_util.h ('k') | chrome/browser/renderer_host/render_widget_host_view_gtk.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "base/gfx/gtk_util.h" 5 #include "base/gfx/gtk_util.h"
6 6
7 #include <gdk/gdk.h> 7 #include <gdk/gdk.h>
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 9
10 #include "base/gfx/rect.h" 10 #include "base/gfx/rect.h"
11 #include "skia/include/SkBitmap.h" 11 #include "skia/include/SkBitmap.h"
12 12
13 namespace gfx { 13 namespace gfx {
14 14
15 const GdkColor kGdkWhite = GDK_COLOR_RGB(0xff, 0xff, 0xff); 15 const GdkColor kGdkWhite = GDK_COLOR_RGB(0xff, 0xff, 0xff);
16 const GdkColor kGdkBlack = GDK_COLOR_RGB(0x00, 0x00, 0x00); 16 const GdkColor kGdkBlack = GDK_COLOR_RGB(0x00, 0x00, 0x00);
17 GdkColor kGdkSeafoamGreen = GDK_COLOR_RGB(0x0, 0xff, 0x80);
17 18
18 void SubtractRectanglesFromRegion(GdkRegion* region, 19 void SubtractRectanglesFromRegion(GdkRegion* region,
19 const std::vector<Rect>& cutouts) { 20 const std::vector<Rect>& cutouts) {
20 for (size_t i = 0; i < cutouts.size(); ++i) { 21 for (size_t i = 0; i < cutouts.size(); ++i) {
21 GdkRectangle rect = cutouts[i].ToGdkRectangle(); 22 GdkRectangle rect = cutouts[i].ToGdkRectangle();
22 GdkRegion* rect_region = gdk_region_rectangle(&rect); 23 GdkRegion* rect_region = gdk_region_rectangle(&rect);
23 gdk_region_subtract(region, rect_region); 24 gdk_region_subtract(region, rect_region);
24 // TODO(deanm): It would be nice to be able to reuse the GdkRegion here. 25 // TODO(deanm): It would be nice to be able to reuse the GdkRegion here.
25 gdk_region_destroy(rect_region); 26 gdk_region_destroy(rect_region);
26 } 27 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 GtkWidget* ebox = gtk_event_box_new(); 73 GtkWidget* ebox = gtk_event_box_new();
73 gtk_widget_modify_bg(ebox, GTK_STATE_NORMAL, color); 74 gtk_widget_modify_bg(ebox, GTK_STATE_NORMAL, color);
74 GtkWidget* alignment = gtk_alignment_new(0, 0, 1, 1); 75 GtkWidget* alignment = gtk_alignment_new(0, 0, 1, 1);
75 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), top, bottom, left, right); 76 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), top, bottom, left, right);
76 gtk_container_add(GTK_CONTAINER(alignment), child); 77 gtk_container_add(GTK_CONTAINER(alignment), child);
77 gtk_container_add(GTK_CONTAINER(ebox), alignment); 78 gtk_container_add(GTK_CONTAINER(ebox), alignment);
78 return ebox; 79 return ebox;
79 } 80 }
80 81
81 } // namespace gfx 82 } // namespace gfx
OLDNEW
« no previous file with comments | « base/gfx/gtk_util.h ('k') | chrome/browser/renderer_host/render_widget_host_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698