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

Unified Diff: compositor/xrender/xrender_visitor.h

Issue 6793005: Add the xrender backend to the window manager. (Closed) Base URL: ssh://gitrw.chromium.org:9222/window_manager.git@master
Patch Set: Add missing trailing _ to root_window and root_geometry. Created 9 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
Index: compositor/xrender/xrender_visitor.h
diff --git a/compositor/xrender/xrender_visitor.h b/compositor/xrender/xrender_visitor.h
new file mode 100644
index 0000000000000000000000000000000000000000..714887ec177d95a38ef47cc43309c0622ac6dd72
--- /dev/null
+++ b/compositor/xrender/xrender_visitor.h
@@ -0,0 +1,85 @@
+// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WINDOW_MANAGER_COMPOSITOR_XRENDER_XRENDER_VISITOR_H_
+#define WINDOW_MANAGER_COMPOSITOR_XRENDER_XRENDER_VISITOR_H_
+
+#include <vector>
Daniel Erat 2011/04/05 01:35:06 delete this; you're not using it
marcheu 2011/04/05 02:07:42 Done.
+
+#include "base/logging.h"
+#include "base/scoped_ptr.h"
+#include "window_manager/compositor/compositor.h"
+#include "window_manager/compositor/real_compositor.h"
+#include "window_manager/compositor/texture_data.h"
+#include "window_manager/x11/x_connection.h"
+
+namespace window_manager {
+
+class ImageContainer;
+
+// This class visits an actor tree and draws it using the XRender extension.
+class XRenderDrawVisitor : virtual public RealCompositor::ActorVisitor {
+ public:
+ XRenderDrawVisitor(RealCompositor* compositor,
+ Compositor::StageActor* stage);
+ virtual ~XRenderDrawVisitor();
+
+ void set_has_fullscreen_actor(bool has_fullscreen_actor) {
+ has_fullscreen_actor_ = has_fullscreen_actor;
+ }
+ void set_damaged_region(Rect damaged_region) {
+ damaged_region_ = damaged_region;
+ }
+
+ void BindImage(const ImageContainer* container,
+ RealCompositor::ImageActor* actor);
+
+ virtual void VisitActor(RealCompositor::Actor* actor) {}
+ virtual void VisitStage(RealCompositor::StageActor* actor);
+ virtual void VisitContainer(RealCompositor::ContainerActor* actor);
+ virtual void VisitImage(RealCompositor::ImageActor* actor);
+ virtual void VisitTexturePixmap(RealCompositor::TexturePixmapActor* actor);
+ virtual void VisitQuad(RealCompositor::QuadActor* actor);
+
+ private:
+ // So it can get access to the config data.
+ friend class XRenderPixmapData;
+
+ virtual bool FreeXResources();
+ virtual bool AllocateXResources(Compositor::StageActor* stage);
+
+ XWindow root_window_;
+ XConnection::WindowGeometry root_geometry_;
+
+ XPicture back_picture_;
Daniel Erat 2011/04/05 01:35:06 third time i've asked: please add a comment descri
marcheu 2011/04/05 02:07:42 Done.
+ XPixmap back_pixmap_;
+
+ XPicture stage_picture_;
+
+ // The visitor should not change settings in the compositor while visiting
+ // actors throughout the drawing process because the compositor may decide
+ // to skip drawing frames as an optimization.
+ RealCompositor* compositor_; // Not owned.
+ XConnection* xconn_; // Not owned.
+ RealCompositor::StageActor* stage_; // Not owned.
+
+ // This is the cumulative opacity of all the ancestors of the
+ // currently visited node. It is recalculated each time we enter or
+ // leave a container node.
+ float ancestor_opacity_;
+
+ // The rectangular region of the screen that is damaged in the frame.
+ // This information allows the draw visitor to perform partial updates.
+ Rect damaged_region_;
+
+ // This is used to indicate whether the entire screen will be covered by an
+ // actor so we can optimize by not clearing the back buffer.
+ bool has_fullscreen_actor_;
+
+ DISALLOW_COPY_AND_ASSIGN(XRenderDrawVisitor);
+};
+
+} // namespace window_manager
+
+#endif // WINDOW_MANAGER_COMPOSITOR_XRENDER_XRENDER_VISITOR_H_

Powered by Google App Engine
This is Rietveld 408576698