diff options
Diffstat (limited to 'chromium/cc')
-rw-r--r-- | chromium/cc/base/util.h | 33 | ||||
-rw-r--r-- | chromium/cc/layers/texture_layer.cc | 2 | ||||
-rw-r--r-- | chromium/cc/output/delegating_renderer.cc | 1 | ||||
-rw-r--r-- | chromium/cc/output/gl_renderer.cc | 1 | ||||
-rw-r--r-- | chromium/cc/quads/content_draw_quad_base.h | 1 | ||||
-rw-r--r-- | chromium/cc/resources/resource_provider.h | 35 | ||||
-rw-r--r-- | chromium/cc/trees/layer_tree_impl.h | 1 |
7 files changed, 33 insertions, 41 deletions
diff --git a/chromium/cc/base/util.h b/chromium/cc/base/util.h index bd511786dca..1d716ae2a42 100644 --- a/chromium/cc/base/util.h +++ b/chromium/cc/base/util.h @@ -8,9 +8,6 @@ #include <limits> #include "base/basictypes.h" -#include "cc/resources/resource_provider.h" -#include "third_party/khronos/GLES2/gl2.h" -#include "third_party/khronos/GLES2/gl2ext.h" namespace cc { @@ -27,36 +24,6 @@ template <typename T> T RoundDown(T n, T mul) { : ((n - mul + 1) / mul) * mul; } -inline GLenum GLDataType(ResourceFormat format) { - DCHECK_LE(format, RESOURCE_FORMAT_MAX); - static const unsigned format_gl_data_type[RESOURCE_FORMAT_MAX + 1] = { - GL_UNSIGNED_BYTE, // RGBA_8888 - GL_UNSIGNED_SHORT_4_4_4_4, // RGBA_4444 - GL_UNSIGNED_BYTE, // BGRA_8888 - GL_UNSIGNED_BYTE, // LUMINANCE_8 - GL_UNSIGNED_SHORT_5_6_5, // RGB_565, - GL_UNSIGNED_BYTE // ETC1 - }; - return format_gl_data_type[format]; -} - -inline GLenum GLDataFormat(ResourceFormat format) { - DCHECK_LE(format, RESOURCE_FORMAT_MAX); - static const unsigned format_gl_data_format[RESOURCE_FORMAT_MAX + 1] = { - GL_RGBA, // RGBA_8888 - GL_RGBA, // RGBA_4444 - GL_BGRA_EXT, // BGRA_8888 - GL_LUMINANCE, // LUMINANCE_8 - GL_RGB, // RGB_565 - GL_ETC1_RGB8_OES // ETC1 - }; - return format_gl_data_format[format]; -} - -inline GLenum GLInternalFormat(ResourceFormat format) { - return GLDataFormat(format); -} - } // namespace cc #endif // CC_BASE_UTIL_H_ diff --git a/chromium/cc/layers/texture_layer.cc b/chromium/cc/layers/texture_layer.cc index 5c954c140c2..195d05ddaba 100644 --- a/chromium/cc/layers/texture_layer.cc +++ b/chromium/cc/layers/texture_layer.cc @@ -13,8 +13,6 @@ #include "cc/resources/single_release_callback.h" #include "cc/trees/blocking_task_runner.h" #include "cc/trees/layer_tree_host.h" -#include "third_party/khronos/GLES2/gl2.h" -#include "third_party/khronos/GLES2/gl2ext.h" namespace cc { diff --git a/chromium/cc/output/delegating_renderer.cc b/chromium/cc/output/delegating_renderer.cc index 1b5716160fa..c76f250754a 100644 --- a/chromium/cc/output/delegating_renderer.cc +++ b/chromium/cc/output/delegating_renderer.cc @@ -25,7 +25,6 @@ #include "gpu/command_buffer/client/context_support.h" #include "gpu/command_buffer/common/gpu_memory_allocation.h" #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" -#include "third_party/khronos/GLES2/gl2.h" #include "third_party/khronos/GLES2/gl2ext.h" using blink::WebGraphicsContext3D; diff --git a/chromium/cc/output/gl_renderer.cc b/chromium/cc/output/gl_renderer.cc index f0e32f43083..04db7b0609b 100644 --- a/chromium/cc/output/gl_renderer.cc +++ b/chromium/cc/output/gl_renderer.cc @@ -16,7 +16,6 @@ #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "build/build_config.h" -#include "cc/base/util.h" #include "cc/base/math_util.h" #include "cc/layers/video_layer_impl.h" #include "cc/output/compositor_frame.h" diff --git a/chromium/cc/quads/content_draw_quad_base.h b/chromium/cc/quads/content_draw_quad_base.h index 6229d615ce1..cbf18ca2b15 100644 --- a/chromium/cc/quads/content_draw_quad_base.h +++ b/chromium/cc/quads/content_draw_quad_base.h @@ -8,6 +8,7 @@ #include "base/memory/scoped_ptr.h" #include "cc/base/cc_export.h" #include "cc/quads/draw_quad.h" +#include "third_party/khronos/GLES2/gl2.h" #include "ui/gfx/point.h" #include "ui/gfx/size.h" diff --git a/chromium/cc/resources/resource_provider.h b/chromium/cc/resources/resource_provider.h index 2478661d62c..6e5c61a2bfa 100644 --- a/chromium/cc/resources/resource_provider.h +++ b/chromium/cc/resources/resource_provider.h @@ -25,6 +25,8 @@ #include "cc/resources/single_release_callback.h" #include "cc/resources/texture_mailbox.h" #include "cc/resources/transferable_resource.h" +#include "third_party/khronos/GLES2/gl2.h" +#include "third_party/khronos/GLES2/gl2ext.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkCanvas.h" #include "ui/gfx/size.h" @@ -34,9 +36,6 @@ namespace gles { class GLES2Interface; } } -// A correct fix would be not to use GL types in this interal API file. -typedef unsigned int GLenum; -typedef int GLint; namespace gfx { class Rect; @@ -526,6 +525,36 @@ inline unsigned BitsPerPixel(ResourceFormat format) { return format_bits_per_pixel[format]; } +inline GLenum GLDataType(ResourceFormat format) { + DCHECK_LE(format, RESOURCE_FORMAT_MAX); + static const unsigned format_gl_data_type[RESOURCE_FORMAT_MAX + 1] = { + GL_UNSIGNED_BYTE, // RGBA_8888 + GL_UNSIGNED_SHORT_4_4_4_4, // RGBA_4444 + GL_UNSIGNED_BYTE, // BGRA_8888 + GL_UNSIGNED_BYTE, // LUMINANCE_8 + GL_UNSIGNED_SHORT_5_6_5, // RGB_565, + GL_UNSIGNED_BYTE // ETC1 + }; + return format_gl_data_type[format]; +} + +inline GLenum GLDataFormat(ResourceFormat format) { + DCHECK_LE(format, RESOURCE_FORMAT_MAX); + static const unsigned format_gl_data_format[RESOURCE_FORMAT_MAX + 1] = { + GL_RGBA, // RGBA_8888 + GL_RGBA, // RGBA_4444 + GL_BGRA_EXT, // BGRA_8888 + GL_LUMINANCE, // LUMINANCE_8 + GL_RGB, // RGB_565 + GL_ETC1_RGB8_OES // ETC1 + }; + return format_gl_data_format[format]; +} + +inline GLenum GLInternalFormat(ResourceFormat format) { + return GLDataFormat(format); +} + } // namespace cc #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ diff --git a/chromium/cc/trees/layer_tree_impl.h b/chromium/cc/trees/layer_tree_impl.h index 85a71f5cd72..2f27460fe04 100644 --- a/chromium/cc/trees/layer_tree_impl.h +++ b/chromium/cc/trees/layer_tree_impl.h @@ -14,7 +14,6 @@ #include "cc/base/scoped_ptr_vector.h" #include "cc/base/swap_promise.h" #include "cc/layers/layer_impl.h" -#include "cc/trees/layer_tree_host.h" #include "cc/resources/ui_resource_client.h" #if defined(COMPILER_GCC) |