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/logging.h" | 7 #include "base/logging.h" |
8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.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" |
11 | 11 |
12 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \ | 12 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \ |
13 defined(USE_OZONE) | 13 defined(USE_OZONE) |
14 #include "ui/gl/gl_surface_egl.h" | 14 #include "ui/gl/gl_surface_egl.h" |
15 #endif | 15 #endif |
16 | 16 |
17 namespace gfx { | 17 namespace gfx { |
18 namespace { | 18 namespace { |
19 | 19 |
20 bool ValidInternalFormat(unsigned internalformat) { | 20 bool ValidInternalFormat(unsigned internalformat) { |
21 switch (internalformat) { | 21 switch (internalformat) { |
22 case GL_RGBA: | 22 case GL_RGBA: |
| 23 case GL_BGRA_EXT: |
23 return true; | 24 return true; |
24 default: | 25 default: |
25 return false; | 26 return false; |
26 } | 27 } |
27 } | 28 } |
28 | 29 |
29 bool ValidFormat(gfx::GpuMemoryBuffer::Format format) { | 30 bool ValidFormat(gfx::GpuMemoryBuffer::Format format) { |
30 switch (format) { | 31 switch (format) { |
31 case gfx::GpuMemoryBuffer::ATC: | 32 case gfx::GpuMemoryBuffer::ATC: |
32 case gfx::GpuMemoryBuffer::ATCIA: | 33 case gfx::GpuMemoryBuffer::ATCIA: |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 size_.width(), | 391 size_.width(), |
391 size_.height(), | 392 size_.height(), |
392 0, // border | 393 0, // border |
393 DataFormat(format_), | 394 DataFormat(format_), |
394 DataType(format_), | 395 DataType(format_), |
395 memory_); | 396 memory_); |
396 } | 397 } |
397 } | 398 } |
398 | 399 |
399 } // namespace gfx | 400 } // namespace gfx |
OLD | NEW |