Index: cc/layer_texture_sub_image.cc |
diff --git a/cc/layer_texture_sub_image.cc b/cc/layer_texture_sub_image.cc |
index 15a876ab1306016227eb68bbec8e19b0dff00b2c..e4ea4d623aa3081a808c93fb2e272f950c33c9ec 100644 |
--- a/cc/layer_texture_sub_image.cc |
+++ b/cc/layer_texture_sub_image.cc |
@@ -6,9 +6,9 @@ |
#include "LayerTextureSubImage.h" |
+#include "third_party/khronos/GLES2/gl2.h" |
+#include "third_party/khronos/GLES2/gl2ext.h" |
#include "CCRendererGL.h" // For the GLC() macro. |
-#include "GraphicsContext3D.h" |
-#include "Extensions3DChromium.h" |
#include "TraceEvent.h" |
#include <public/WebGraphicsContext3D.h> |
@@ -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: |