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

Side by Side Diff: ui/gl/gl_image_memory.h

Issue 1323593003: Log both GL and cpu-side memory in GLImage*Memory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium 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 UI_GL_GL_IMAGE_MEMORY_H_ 5 #ifndef UI_GL_GL_IMAGE_MEMORY_H_
6 #define UI_GL_GL_IMAGE_MEMORY_H_ 6 #define UI_GL_GL_IMAGE_MEMORY_H_
7 7
8 #include "ui/gl/gl_image.h" 8 #include "ui/gl/gl_image.h"
9 9
10 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \ 10 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \
(...skipping 28 matching lines...) Expand all
39 const Rect& rect) override; 39 const Rect& rect) override;
40 void WillUseTexImage() override; 40 void WillUseTexImage() override;
41 void DidUseTexImage() override; 41 void DidUseTexImage() override;
42 void WillModifyTexImage() override {} 42 void WillModifyTexImage() override {}
43 void DidModifyTexImage() override {} 43 void DidModifyTexImage() override {}
44 bool ScheduleOverlayPlane(AcceleratedWidget widget, 44 bool ScheduleOverlayPlane(AcceleratedWidget widget,
45 int z_order, 45 int z_order,
46 OverlayTransform transform, 46 OverlayTransform transform,
47 const Rect& bounds_rect, 47 const Rect& bounds_rect,
48 const RectF& crop_rect) override; 48 const RectF& crop_rect) override;
49
50 // Only dumps the GLTexture portion of the memory usage. Subclasses are
51 // responsible for dumping the CPU-side memory.
49 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, 52 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
ericrk 2015/08/31 17:19:32 Mojo uses GLImageMemory directly (now I remember w
50 uint64_t process_tracing_id, 53 uint64_t process_tracing_id,
51 const std::string& dump_name) override; 54 const std::string& dump_name) override;
52 55
53 protected: 56 protected:
54 ~GLImageMemory() override; 57 ~GLImageMemory() override;
55 58
56 BufferFormat format() const { return format_; } 59 BufferFormat format() const { return format_; }
57 60
58 private: 61 private:
59 void DoBindTexImage(unsigned target); 62 void DoBindTexImage(unsigned target);
60 63
61 const Size size_; 64 const Size size_;
62 const unsigned internalformat_; 65 const unsigned internalformat_;
63 const unsigned char* memory_; 66 const unsigned char* memory_;
64 BufferFormat format_; 67 BufferFormat format_;
65 bool in_use_; 68 bool in_use_;
66 unsigned target_; 69 unsigned target_;
67 bool need_do_bind_tex_image_; 70 bool need_do_bind_tex_image_;
71 unsigned texture_id_;
72 bool need_to_free_texture_id_;
reveman 2015/08/31 17:38:48 I don't think you need these. See my comment below
ericrk 2015/08/31 18:31:14 removed / simplified.
68 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \ 73 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \
69 defined(USE_OZONE) 74 defined(USE_OZONE)
70 unsigned egl_texture_id_;
71 EGLImageKHR egl_image_; 75 EGLImageKHR egl_image_;
72 #endif 76 #endif
73 77
74 DISALLOW_COPY_AND_ASSIGN(GLImageMemory); 78 DISALLOW_COPY_AND_ASSIGN(GLImageMemory);
75 }; 79 };
76 80
77 } // namespace gfx 81 } // namespace gfx
78 82
79 #endif // UI_GL_GL_IMAGE_MEMORY_H_ 83 #endif // UI_GL_GL_IMAGE_MEMORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698