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 #include "ui/gl/gl_image_memory.h" | 5 #include "ui/gl/gl_image_memory.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "ui/gl/gl_bindings.h" | 9 #include "ui/gl/gl_bindings.h" |
10 #include "ui/gl/scoped_binders.h" | 10 #include "ui/gl/scoped_binders.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 GLImageMemory::~GLImageMemory() { | 94 GLImageMemory::~GLImageMemory() { |
95 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \ | 95 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \ |
96 defined(USE_OZONE) | 96 defined(USE_OZONE) |
97 DCHECK_EQ(EGL_NO_IMAGE_KHR, egl_image_); | 97 DCHECK_EQ(EGL_NO_IMAGE_KHR, egl_image_); |
98 DCHECK_EQ(0u, egl_texture_id_); | 98 DCHECK_EQ(0u, egl_texture_id_); |
99 #endif | 99 #endif |
100 } | 100 } |
101 | 101 |
102 // static | 102 // static |
103 size_t GLImageMemory::BytesPerPixel(gfx::GpuMemoryBuffer::Format format) { | 103 size_t GLImageMemory::BitsPerPixel(gfx::GpuMemoryBuffer::Format format) { |
104 switch (format) { | 104 switch (format) { |
105 case gfx::GpuMemoryBuffer::RGBA_8888: | 105 case gfx::GpuMemoryBuffer::RGBA_8888: |
106 case gfx::GpuMemoryBuffer::BGRA_8888: | 106 case gfx::GpuMemoryBuffer::BGRA_8888: |
107 return 4; | 107 return 32; |
108 case gfx::GpuMemoryBuffer::RGBX_8888: | 108 case gfx::GpuMemoryBuffer::RGBX_8888: |
109 NOTREACHED(); | 109 NOTREACHED(); |
110 return 0; | 110 return 0; |
111 } | 111 } |
112 | 112 |
113 NOTREACHED(); | 113 NOTREACHED(); |
114 return 0; | 114 return 0; |
115 } | 115 } |
116 | 116 |
117 bool GLImageMemory::Initialize(const unsigned char* memory, | 117 bool GLImageMemory::Initialize(const unsigned char* memory, |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 TextureFormat(format_), | 280 TextureFormat(format_), |
281 size_.width(), | 281 size_.width(), |
282 size_.height(), | 282 size_.height(), |
283 0, // border | 283 0, // border |
284 DataFormat(format_), | 284 DataFormat(format_), |
285 DataType(format_), | 285 DataType(format_), |
286 memory_); | 286 memory_); |
287 } | 287 } |
288 | 288 |
289 } // namespace gfx | 289 } // namespace gfx |
OLD | NEW |