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

Unified Diff: ui/gfx/compositor/compositor_gl.cc

Issue 7273073: Animated Rotation (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Move compositing notifications to Layer Created 9 years, 4 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
Index: ui/gfx/compositor/compositor_gl.cc
diff --git a/ui/gfx/compositor/compositor_gl.cc b/ui/gfx/compositor/compositor_gl.cc
index c9e6dfa2b41122513ca88e7c2272c661f9aa095c..c06d7d8f7a271e2b72ee7da82b9ba05550ea0be1 100644
--- a/ui/gfx/compositor/compositor_gl.cc
+++ b/ui/gfx/compositor/compositor_gl.cc
@@ -4,6 +4,10 @@
#include "ui/gfx/compositor/compositor_gl.h"
+// for CompositorGL::SchedulePaint
+#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
+
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
@@ -448,6 +452,7 @@ void TextureGL::DrawInternal(const ui::TextureProgramGL& program,
CompositorGL::CompositorGL(gfx::AcceleratedWidget widget,
const gfx::Size& size)
: Compositor(size),
+ widget_(widget),
started_(false) {
gl_surface_ = gfx::GLSurface::CreateViewGLSurface(false, widget);
gl_context_ = SharedResources::GetInstance()->
@@ -498,8 +503,16 @@ void CompositorGL::Blur(const gfx::Rect& bounds) {
}
void CompositorGL::SchedulePaint() {
- // TODO: X doesn't provide coalescing of regions, its left to the toolkit.
- NOTIMPLEMENTED();
+ // TODO(vollick) Remove or ifdef the gdk/gtk code.
+ GdkDisplay* display = gdk_display_get_default();
+ GdkWindow* window = gdk_window_lookup_for_display(display, widget_);
+ if (window == NULL)
+ return;
+ gpointer data = NULL;
+ gdk_window_get_user_data(window, &data);
+ GtkWidget* widget = reinterpret_cast<GtkWidget*>(data);
+ if (widget && GTK_IS_WIDGET(widget) && GTK_WIDGET_DRAWABLE(widget))
+ gtk_widget_queue_draw_area(widget, 0, 0, size().width(), size().height());
}
// static
« no previous file with comments | « ui/gfx/compositor/compositor_gl.h ('k') | ui/gfx/compositor/layer.h » ('j') | views/view.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698