OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef WINDOW_MANAGER_COMPOSITOR_XRENDER_XRENDER_VISITOR_H_ | |
6 #define WINDOW_MANAGER_COMPOSITOR_XRENDER_XRENDER_VISITOR_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "base/logging.h" | |
11 #include "base/scoped_ptr.h" | |
12 #include "window_manager/compositor/compositor.h" | |
13 #include "window_manager/compositor/real_compositor.h" | |
14 #include "window_manager/compositor/texture_data.h" | |
15 #include "window_manager/x11/x_connection.h" | |
16 | |
17 namespace window_manager { | |
18 | |
19 class ImageContainer; | |
20 | |
21 // This class visits an actor tree and draws it using the XRender extension. | |
22 class XRenderDrawVisitor : virtual public RealCompositor::ActorVisitor { | |
23 public: | |
24 XRenderDrawVisitor(RealCompositor* compositor, | |
25 Compositor::StageActor* stage); | |
Daniel Erat
2011/04/04 21:16:35
not your fault (the gl and gles implementations do
| |
26 virtual ~XRenderDrawVisitor(); | |
27 | |
28 XConnection* xconn() { return xconn_; } | |
29 void set_has_fullscreen_actor(bool has_fullscreen_actor) { | |
30 has_fullscreen_actor_ = has_fullscreen_actor; | |
31 } | |
32 void set_damaged_region(Rect damaged_region) { | |
Daniel Erat
2011/04/04 21:16:35
nit: s/Rect/const Rect&/ (i'm cleaning this up in
| |
33 damaged_region_ = damaged_region; | |
34 } | |
35 | |
36 void BindImage(const ImageContainer* container, | |
37 RealCompositor::ImageActor* actor); | |
38 | |
39 virtual void VisitActor(RealCompositor::Actor* actor) {} | |
40 virtual void VisitStage(RealCompositor::StageActor* actor); | |
41 virtual void VisitContainer(RealCompositor::ContainerActor* actor); | |
42 virtual void VisitImage(RealCompositor::ImageActor* actor); | |
43 virtual void VisitTexturePixmap(RealCompositor::TexturePixmapActor* actor); | |
44 virtual void VisitQuad(RealCompositor::QuadActor* actor); | |
45 | |
46 private: | |
47 // So it can get access to the config data. | |
48 friend class XRenderPixmapData; | |
49 | |
50 XWindow root_window; | |
Daniel Erat
2011/04/04 21:16:35
add trailing underscore
| |
51 XConnection::WindowGeometry root_geometry; | |
Daniel Erat
2011/04/04 21:16:35
add trailing underscore
| |
52 | |
53 XPicture back_picture_; | |
Daniel Erat
2011/04/04 21:16:35
these should still have comments with brief descri
| |
54 XPixmap back_pixmap_; | |
55 | |
56 XPicture stage_picture_; | |
57 | |
58 // The visitor should not change settings in the compositor while visiting | |
59 // actors throughout the drawing process because the compositor may decide | |
60 // to skip drawing frames as an optimization. | |
61 RealCompositor* compositor_; // Not owned. | |
62 XConnection* xconn_; // Not owned. | |
63 RealCompositor::StageActor* stage_; // Not owned. | |
64 | |
65 // This is the cumulative opacity of all the ancestors of the | |
66 // currently visited node. It is recalculated each time we enter or | |
67 // leave a container node. | |
68 float ancestor_opacity_; | |
69 | |
70 // The rectangular region of the screen that is damaged in the frame. | |
71 // This information allows the draw visitor to perform partial updates. | |
72 Rect damaged_region_; | |
73 | |
74 // This is used to indicate whether the entire screen will be covered by an | |
75 // actor so we can optimize by not clearing the back buffer. | |
76 bool has_fullscreen_actor_; | |
77 | |
78 DISALLOW_COPY_AND_ASSIGN(XRenderDrawVisitor); | |
79 }; | |
80 | |
81 } // namespace window_manager | |
82 | |
83 #endif // WINDOW_MANAGER_COMPOSITOR_XRENDER_XRENDER_VISITOR_H_ | |
OLD | NEW |