OLD | NEW |
---|---|
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 Loading... | |
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 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, | |
50 uint64_t process_tracing_id, | |
51 const std::string& dump_name) override; | |
52 | 49 |
53 protected: | 50 protected: |
54 ~GLImageMemory() override; | 51 ~GLImageMemory() override; |
55 | 52 |
56 BufferFormat format() const { return format_; } | 53 BufferFormat format() const { return format_; } |
57 | 54 |
55 // Called by sub-classes to ask GLImageMemory to dump the GLTexture portion | |
56 // of its memory usage. | |
57 void DumpGLTexture(base::trace_event::ProcessMemoryDump* pmd, | |
reveman
2015/08/28 18:18:43
nit: OnTextureMemoryDump maybe?
ericrk
2015/08/31 17:19:32
done.
| |
58 const std::string& dump_name); | |
59 | |
58 private: | 60 private: |
59 void DoBindTexImage(unsigned target); | 61 void DoBindTexImage(unsigned target); |
60 | 62 |
61 const Size size_; | 63 const Size size_; |
62 const unsigned internalformat_; | 64 const unsigned internalformat_; |
63 const unsigned char* memory_; | 65 const unsigned char* memory_; |
64 BufferFormat format_; | 66 BufferFormat format_; |
65 bool in_use_; | 67 bool in_use_; |
66 unsigned target_; | 68 unsigned target_; |
67 bool need_do_bind_tex_image_; | 69 bool need_do_bind_tex_image_; |
68 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \ | 70 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \ |
69 defined(USE_OZONE) | 71 defined(USE_OZONE) |
70 unsigned egl_texture_id_; | 72 unsigned egl_texture_id_; |
71 EGLImageKHR egl_image_; | 73 EGLImageKHR egl_image_; |
72 #endif | 74 #endif |
73 | 75 |
74 DISALLOW_COPY_AND_ASSIGN(GLImageMemory); | 76 DISALLOW_COPY_AND_ASSIGN(GLImageMemory); |
75 }; | 77 }; |
76 | 78 |
77 } // namespace gfx | 79 } // namespace gfx |
78 | 80 |
79 #endif // UI_GL_GL_IMAGE_MEMORY_H_ | 81 #endif // UI_GL_GL_IMAGE_MEMORY_H_ |
OLD | NEW |