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

Side by Side Diff: compositor/gles/opengles_visitor.h

Issue 6691037: wm: Fix an uncommon memory leak in the compositor code. (Closed) Base URL: ssh://gitrw.chromium.org:9222/window_manager.git@master
Patch Set: update another arg to be a const ref Created 9 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « compositor/gl/opengl_visitor.cc ('k') | compositor/gles/opengles_visitor.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) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS 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 #ifndef WINDOW_MANAGER_COMPOSITOR_GLES_GLES_VISITOR_H_ 5 #ifndef WINDOW_MANAGER_COMPOSITOR_GLES_GLES_VISITOR_H_
6 #define WINDOW_MANAGER_COMPOSITOR_GLES_GLES_VISITOR_H_ 6 #define WINDOW_MANAGER_COMPOSITOR_GLES_GLES_VISITOR_H_
7 7
8 #include <GLES2/gl2.h> 8 #include <GLES2/gl2.h>
9 #include <EGL/egl.h> 9 #include <EGL/egl.h>
10 #include <EGL/eglext.h> 10 #include <EGL/eglext.h>
(...skipping 18 matching lines...) Expand all
29 // This class vists an actor tree and draws it using OpenGLES 29 // This class vists an actor tree and draws it using OpenGLES
30 class OpenGlesDrawVisitor : virtual public RealCompositor::ActorVisitor { 30 class OpenGlesDrawVisitor : virtual public RealCompositor::ActorVisitor {
31 public: 31 public:
32 OpenGlesDrawVisitor(Gles2Interface* gl, 32 OpenGlesDrawVisitor(Gles2Interface* gl,
33 RealCompositor* compositor, 33 RealCompositor* compositor,
34 Compositor::StageActor* stage); 34 Compositor::StageActor* stage);
35 virtual ~OpenGlesDrawVisitor(); 35 virtual ~OpenGlesDrawVisitor();
36 void set_has_fullscreen_actor(bool has_fullscreen_actor) { 36 void set_has_fullscreen_actor(bool has_fullscreen_actor) {
37 has_fullscreen_actor_ = has_fullscreen_actor; 37 has_fullscreen_actor_ = has_fullscreen_actor;
38 } 38 }
39 void set_damaged_region(Rect damaged_region) { 39 void set_damaged_region(const Rect& damaged_region) {
40 damaged_region_ = damaged_region; 40 damaged_region_ = damaged_region;
41 } 41 }
42 42
43 void BindImage(const ImageContainer* container, 43 void BindImage(const ImageContainer* container,
44 RealCompositor::QuadActor* actor); 44 RealCompositor::QuadActor* actor);
45 45
46 virtual void VisitActor(RealCompositor::Actor* actor) {} 46 virtual void VisitActor(RealCompositor::Actor* actor) {}
47 virtual void VisitStage(RealCompositor::StageActor* actor); 47 virtual void VisitStage(RealCompositor::StageActor* actor);
48 virtual void VisitContainer(RealCompositor::ContainerActor* actor); 48 virtual void VisitContainer(RealCompositor::ContainerActor* actor);
49 virtual void VisitImage(RealCompositor::ImageActor* actor); 49 virtual void VisitImage(RealCompositor::ImageActor* actor);
(...skipping 11 matching lines...) Expand all
61 // scissoring if the stack is now empty. 61 // scissoring if the stack is now empty.
62 void PushScissorRect(const Rect& scissor); 62 void PushScissorRect(const Rect& scissor);
63 void PopScissorRect(); 63 void PopScissorRect();
64 64
65 private: 65 private:
66 Gles2Interface* gl_; // Not owned. 66 Gles2Interface* gl_; // Not owned.
67 RealCompositor* compositor_; // Not owned. 67 RealCompositor* compositor_; // Not owned.
68 Compositor::StageActor* stage_; // Not owned. 68 Compositor::StageActor* stage_; // Not owned.
69 XConnection* x_connection_; // Not owned. 69 XConnection* x_connection_; // Not owned.
70 70
71 TexColorShader* tex_color_shader_; 71 scoped_ptr<TexColorShader> tex_color_shader_;
72 TexShadeShader* tex_shade_shader_; 72 scoped_ptr<TexShadeShader> tex_shade_shader_;
73 NoAlphaColorShader* no_alpha_color_shader_; 73 scoped_ptr<NoAlphaColorShader> no_alpha_color_shader_;
74 NoAlphaShadeShader* no_alpha_shade_shader_; 74 scoped_ptr<NoAlphaShadeShader> no_alpha_shade_shader_;
75 75
76 EGLDisplay egl_display_; 76 EGLDisplay egl_display_;
77 EGLSurface egl_surface_; 77 EGLSurface egl_surface_;
78 bool egl_surface_is_capable_of_partial_updates_; 78 bool egl_surface_is_capable_of_partial_updates_;
79 EGLContext egl_context_; 79 EGLContext egl_context_;
80 80
81 // Matrix state 81 // Matrix state
82 Matrix4 projection_; 82 Matrix4 projection_;
83 83
84 // Scissor rect data. 84 // Scissor rect data.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // Not owned. 152 // Not owned.
153 Gles2Interface* gl_; 153 Gles2Interface* gl_;
154 154
155 // EGLImage 155 // EGLImage
156 EGLImageKHR egl_image_; 156 EGLImageKHR egl_image_;
157 }; 157 };
158 158
159 } // namespace window_manager 159 } // namespace window_manager
160 160
161 #endif // WINDOW_MANAGER_COMPOSITOR_GLES_GLES_VISITOR_H_ 161 #endif // WINDOW_MANAGER_COMPOSITOR_GLES_GLES_VISITOR_H_
OLDNEW
« no previous file with comments | « compositor/gl/opengl_visitor.cc ('k') | compositor/gles/opengles_visitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698