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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_gtk.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/gfx/gtk_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/render_widget_host_view_gtk.cc
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
index 08c0d4fef8b9c680c7340b95fbc47066e202e92c..4bc769cdddb95424724a4f827d89a921da12b9bf 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -9,6 +9,7 @@
#include <cairo/cairo.h>
#include "base/logging.h"
+#include "base/gfx/gtk_util.h"
#include "base/string_util.h"
#include "chrome/common/native_web_keyboard_event.h"
#include "chrome/common/x11_util.h"
@@ -340,16 +341,28 @@ BackingStore* RenderWidgetHostViewGtk::AllocBackingStore(
void RenderWidgetHostViewGtk::Paint(const gfx::Rect& damage_rect) {
BackingStore* backing_store = host_->GetBackingStore();
+ GdkWindow* window = view_.get()->window;
if (backing_store) {
// Only render the widget if it is attached to a window; there's a short
// period where this object isn't attached to a window but hasn't been
// Destroy()ed yet and it receives paint messages...
- GdkWindow* window = view_.get()->window;
if (window) {
backing_store->ShowRect(
damage_rect, x11_util::GetX11WindowFromGtkWidget(view_.get()));
}
} else {
+ if (window) {
+ // Set the window background to sea foam green.
+ if (!gfx::kGdkSeafoamGreen.pixel) {
+ // We need the color "allocated" to use for the window background.
+ gdk_colormap_alloc_color(gdk_colormap_get_system(),
+ &gfx::kGdkSeafoamGreen,
+ FALSE /* not writable */,
+ TRUE /* best match */);
+ }
+ gdk_window_set_background(window, &gfx::kGdkSeafoamGreen);
+ gdk_window_clear(window);
+ }
NOTIMPLEMENTED();
}
}
« no previous file with comments | « base/gfx/gtk_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698