| Index: cc/layer_texture_sub_image.cc
|
| diff --git a/cc/layer_texture_sub_image.cc b/cc/layer_texture_sub_image.cc
|
| index 2261bf98529e46fcd1eaa06ca8e4095e2b7adae9..7de71598e8613e99b81faf61d9b8d098eaea729a 100644
|
| --- a/cc/layer_texture_sub_image.cc
|
| +++ b/cc/layer_texture_sub_image.cc
|
| @@ -7,9 +7,9 @@
|
| #include "cc/layer_texture_sub_image.h"
|
|
|
| #include "CCRendererGL.h" // For the GLC() macro.
|
| -#include "GraphicsContext3D.h"
|
| -#include "Extensions3DChromium.h"
|
| #include "base/debug/trace_event.h"
|
| +#include "third_party/khronos/GLES2/gl2.h"
|
| +#include "third_party/khronos/GLES2/gl2ext.h"
|
| #include <public/WebGraphicsContext3D.h>
|
|
|
| using WebKit::WebGraphicsContext3D;
|
| @@ -28,7 +28,7 @@ LayerTextureSubImage::~LayerTextureSubImage()
|
|
|
| void LayerTextureSubImage::upload(const uint8_t* image, const IntRect& imageRect,
|
| const IntRect& sourceRect, const IntSize& destOffset,
|
| - GC3Denum format, WebGraphicsContext3D* context)
|
| + GLenum format, WebGraphicsContext3D* context)
|
| {
|
| if (m_useMapTexSubImage)
|
| uploadWithMapTexSubImage(image, imageRect, sourceRect, destOffset, format, context);
|
| @@ -38,7 +38,7 @@ void LayerTextureSubImage::upload(const uint8_t* image, const IntRect& imageRect
|
|
|
| void LayerTextureSubImage::uploadWithTexSubImage(const uint8_t* image, const IntRect& imageRect,
|
| const IntRect& sourceRect, const IntSize& destOffset,
|
| - GC3Denum format, WebGraphicsContext3D* context)
|
| + GLenum format, WebGraphicsContext3D* context)
|
| {
|
| TRACE_EVENT0("cc", "LayerTextureSubImage::uploadWithTexSubImage");
|
|
|
| @@ -64,19 +64,19 @@ void LayerTextureSubImage::uploadWithTexSubImage(const uint8_t* image, const Int
|
| pixelSource = &m_subImage[0];
|
| }
|
|
|
| - GLC(context, context->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, destOffset.width(), destOffset.height(), sourceRect.width(), sourceRect.height(), format, GraphicsContext3D::UNSIGNED_BYTE, pixelSource));
|
| + GLC(context, context->texSubImage2D(GL_TEXTURE_2D, 0, destOffset.width(), destOffset.height(), sourceRect.width(), sourceRect.height(), format, GL_UNSIGNED_BYTE, pixelSource));
|
| }
|
|
|
| void LayerTextureSubImage::uploadWithMapTexSubImage(const uint8_t* image, const IntRect& imageRect,
|
| const IntRect& sourceRect, const IntSize& destOffset,
|
| - GC3Denum format, WebGraphicsContext3D* context)
|
| + GLenum format, WebGraphicsContext3D* context)
|
| {
|
| TRACE_EVENT0("cc", "LayerTextureSubImage::uploadWithMapTexSubImage");
|
| // Offset from image-rect to source-rect.
|
| IntPoint offset(sourceRect.x() - imageRect.x(), sourceRect.y() - imageRect.y());
|
|
|
| // Upload tile data via a mapped transfer buffer
|
| - uint8_t* pixelDest = static_cast<uint8_t*>(context->mapTexSubImage2DCHROMIUM(GraphicsContext3D::TEXTURE_2D, 0, destOffset.width(), destOffset.height(), sourceRect.width(), sourceRect.height(), format, GraphicsContext3D::UNSIGNED_BYTE, Extensions3DChromium::WRITE_ONLY));
|
| + uint8_t* pixelDest = static_cast<uint8_t*>(context->mapTexSubImage2DCHROMIUM(GL_TEXTURE_2D, 0, destOffset.width(), destOffset.height(), sourceRect.width(), sourceRect.height(), format, GL_UNSIGNED_BYTE, GL_WRITE_ONLY));
|
|
|
| if (!pixelDest) {
|
| uploadWithTexSubImage(image, imageRect, sourceRect, destOffset, format, context);
|
| @@ -85,11 +85,11 @@ void LayerTextureSubImage::uploadWithMapTexSubImage(const uint8_t* image, const
|
|
|
| unsigned int componentsPerPixel = 0;
|
| switch (format) {
|
| - case GraphicsContext3D::RGBA:
|
| - case Extensions3D::BGRA_EXT:
|
| + case GL_RGBA:
|
| + case GL_BGRA_EXT:
|
| componentsPerPixel = 4;
|
| break;
|
| - case GraphicsContext3D::LUMINANCE:
|
| + case GL_LUMINANCE:
|
| componentsPerPixel = 1;
|
| break;
|
| default:
|
|
|