Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3136)

Unified Diff: cc/layer_texture_sub_image.cc

Issue 11150025: Patch from https://codereview.chromium.org/11111005/ without actual file deletes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layer_texture_sub_image.h ('k') | cc/layer_texture_updater.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « cc/layer_texture_sub_image.h ('k') | cc/layer_texture_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698