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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 OverlayTransform transform, | 44 OverlayTransform transform, |
45 const Rect& bounds_rect, | 45 const Rect& bounds_rect, |
46 const RectF& crop_rect) override; | 46 const RectF& crop_rect) override; |
47 | 47 |
48 protected: | 48 protected: |
49 ~GLImageMemory() override; | 49 ~GLImageMemory() override; |
50 | 50 |
51 private: | 51 private: |
52 void DoBindTexImage(unsigned target); | 52 void DoBindTexImage(unsigned target); |
53 | 53 |
| 54 size_t MemoryBytes(gfx::GpuMemoryBuffer::Format format); |
| 55 |
54 const gfx::Size size_; | 56 const gfx::Size size_; |
55 const unsigned internalformat_; | 57 const unsigned internalformat_; |
56 const unsigned char* memory_; | 58 const unsigned char* memory_; |
57 gfx::GpuMemoryBuffer::Format format_; | 59 gfx::GpuMemoryBuffer::Format format_; |
58 bool in_use_; | 60 bool in_use_; |
59 unsigned target_; | 61 unsigned target_; |
60 bool need_do_bind_tex_image_; | 62 bool need_do_bind_tex_image_; |
61 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \ | 63 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \ |
62 defined(USE_OZONE) | 64 defined(USE_OZONE) |
63 unsigned egl_texture_id_; | 65 unsigned egl_texture_id_; |
64 EGLImageKHR egl_image_; | 66 EGLImageKHR egl_image_; |
65 #endif | 67 #endif |
66 | 68 |
67 DISALLOW_COPY_AND_ASSIGN(GLImageMemory); | 69 DISALLOW_COPY_AND_ASSIGN(GLImageMemory); |
68 }; | 70 }; |
69 | 71 |
70 } // namespace gfx | 72 } // namespace gfx |
71 | 73 |
72 #endif // UI_GL_GL_IMAGE_MEMORY_H_ | 74 #endif // UI_GL_GL_IMAGE_MEMORY_H_ |
OLD | NEW |