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

Side by Side Diff: compositor/mock_compositor.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/gles/opengles_visitor.cc ('k') | compositor/mock_compositor.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_MOCK_COMPOSITOR_H_ 5 #ifndef WINDOW_MANAGER_COMPOSITOR_MOCK_COMPOSITOR_H_
6 #define WINDOW_MANAGER_COMPOSITOR_MOCK_COMPOSITOR_H_ 6 #define WINDOW_MANAGER_COMPOSITOR_MOCK_COMPOSITOR_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 197
198 private: 198 private:
199 DISALLOW_COPY_AND_ASSIGN(ImageActor); 199 DISALLOW_COPY_AND_ASSIGN(ImageActor);
200 }; 200 };
201 201
202 class TexturePixmapActor : public MockCompositor::Actor, 202 class TexturePixmapActor : public MockCompositor::Actor,
203 public Compositor::TexturePixmapActor { 203 public Compositor::TexturePixmapActor {
204 public: 204 public:
205 explicit TexturePixmapActor(XConnection* xconn); 205 explicit TexturePixmapActor(XConnection* xconn);
206 virtual ~TexturePixmapActor(); 206 virtual ~TexturePixmapActor();
207 const uint8_t* alpha_mask_bytes() const { return alpha_mask_bytes_; } 207 const uint8_t* alpha_mask_bytes() const { return alpha_mask_bytes_.get(); }
208 XID pixmap() const { return pixmap_; } 208 XID pixmap() const { return pixmap_; }
209 int num_texture_updates() const { return num_texture_updates_; } 209 int num_texture_updates() const { return num_texture_updates_; }
210 210
211 // Begin Compositor::TexturePixmapActor methods. 211 // Begin Compositor::TexturePixmapActor methods.
212 virtual void SetPixmap(XID pixmap); 212 virtual void SetPixmap(XID pixmap);
213 virtual void UpdateTexture() { num_texture_updates_++; } 213 virtual void UpdateTexture() { num_texture_updates_++; }
214 virtual void SetAlphaMask(const uint8_t* bytes, int width, int height); 214 virtual void SetAlphaMask(const uint8_t* bytes, int width, int height);
215 virtual void ClearAlphaMask(); 215 virtual void ClearAlphaMask();
216 virtual void MergeDamagedRegion(const Rect& region); 216 virtual void MergeDamagedRegion(const Rect& region);
217 virtual const Rect& GetDamagedRegion() const; 217 virtual const Rect& GetDamagedRegion() const;
218 virtual void ResetDamagedRegion(); 218 virtual void ResetDamagedRegion();
219 // End Compositor::TexturePixmapActor methods. 219 // End Compositor::TexturePixmapActor methods.
220 220
221 private: 221 private:
222 XConnection* xconn_; // not owned 222 XConnection* xconn_; // not owned
223 223
224 // Shape as set by SetAlphaMask(), or NULL if the actor is unshaped. 224 // Shape as set by SetAlphaMask(), or NULL if the actor is unshaped.
225 uint8_t* alpha_mask_bytes_; 225 scoped_array<uint8_t> alpha_mask_bytes_;
226 226
227 // Redirected window that we're tracking. 227 // Redirected window that we're tracking.
228 XWindow redirected_window_; 228 XWindow redirected_window_;
229 229
230 // Pixmap that we're displaying. 230 // Pixmap that we're displaying.
231 XID pixmap_; 231 XID pixmap_;
232 232
233 // Number of times that UpdateTexture() has been called. 233 // Number of times that UpdateTexture() has been called.
234 int num_texture_updates_; 234 int num_texture_updates_;
235 235
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 StageActor default_stage_; 281 StageActor default_stage_;
282 std::tr1::unordered_set<int> active_visibility_groups_; 282 std::tr1::unordered_set<int> active_visibility_groups_;
283 int num_draws_; 283 int num_draws_;
284 284
285 DISALLOW_COPY_AND_ASSIGN(MockCompositor); 285 DISALLOW_COPY_AND_ASSIGN(MockCompositor);
286 }; 286 };
287 287
288 } // namespace window_manager 288 } // namespace window_manager
289 289
290 #endif // WINDOW_MANAGER_COMPOSITOR_MOCK_COMPOSITOR_H_ 290 #endif // WINDOW_MANAGER_COMPOSITOR_MOCK_COMPOSITOR_H_
OLDNEW
« no previous file with comments | « compositor/gles/opengles_visitor.cc ('k') | compositor/mock_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698