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

Unified Diff: Source/core/platform/graphics/filters/custom/CustomFilterRenderer.cpp

Issue 93873009: Moved GL enums from GraphicsContext3D to a more generic location. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Removed unneeded include Created 7 years 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
Index: Source/core/platform/graphics/filters/custom/CustomFilterRenderer.cpp
diff --git a/Source/core/platform/graphics/filters/custom/CustomFilterRenderer.cpp b/Source/core/platform/graphics/filters/custom/CustomFilterRenderer.cpp
index 014ea6425d0f494f8353b5c70521e93b4b83e262..bec7a757d482f56d4fe40cd5d70c5e92c0c8d9dc 100644
--- a/Source/core/platform/graphics/filters/custom/CustomFilterRenderer.cpp
+++ b/Source/core/platform/graphics/filters/custom/CustomFilterRenderer.cpp
@@ -40,6 +40,7 @@
#include "platform/graphics/filters/custom/CustomFilterParameter.h"
#include "platform/graphics/filters/custom/CustomFilterTransformParameter.h"
#include "platform/transforms/TransformationMatrix.h"
+#include "third_party/khronos/GLES2/gl2.h"
Ken Russell (switch to Gerrit) 2013/12/06 23:45:20 Should be unnecessary.
namespace WebCore {
@@ -104,7 +105,7 @@ void CustomFilterRenderer::draw(Platform3DObject inputTexture, const IntSize& si
m_contextSize = size;
bindProgramAndBuffers(inputTexture);
- m_context->drawElements(GraphicsContext3D::TRIANGLES, m_mesh->indicesCount(), GraphicsContext3D::UNSIGNED_SHORT, 0);
+ m_context->drawElements(GL_TRIANGLES, m_mesh->indicesCount(), GL_UNSIGNED_SHORT, 0);
unbindVertexAttributes();
}
@@ -136,7 +137,7 @@ void CustomFilterRenderer::initializeMeshIfNeeded()
void CustomFilterRenderer::bindVertexAttribute(int attributeLocation, unsigned size, unsigned offset)
{
if (attributeLocation != -1) {
- m_context->vertexAttribPointer(attributeLocation, size, GraphicsContext3D::FLOAT, false, m_mesh->bytesPerVertex(), offset);
+ m_context->vertexAttribPointer(attributeLocation, size, GL_FLOAT, false, m_mesh->bytesPerVertex(), offset);
m_context->enableVertexAttribArray(attributeLocation);
}
}
@@ -233,13 +234,13 @@ void CustomFilterRenderer::bindProgramAndBuffers(Platform3DObject inputTexture)
ASSERT(m_programType == ProgramTypeBlendsElementTexture);
ASSERT(m_compiledProgram->samplerLocation() != -1);
- m_context->activeTexture(GraphicsContext3D::TEXTURE0);
+ m_context->activeTexture(GL_TEXTURE0);
m_context->uniform1i(m_compiledProgram->samplerLocation(), 0);
- m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, inputTexture);
- m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR);
- m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR);
- m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE);
- m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE);
+ m_context->bindTexture(GL_TEXTURE_2D, inputTexture);
+ m_context->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ m_context->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ m_context->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ m_context->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
if (m_compiledProgram->projectionMatrixLocation() != -1) {
@@ -268,8 +269,8 @@ void CustomFilterRenderer::bindProgramAndBuffers(Platform3DObject inputTexture)
if (m_compiledProgram->samplerSizeLocation() != -1)
m_context->uniform2f(m_compiledProgram->samplerSizeLocation(), m_contextSize.width(), m_contextSize.height());
- m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_mesh->verticesBufferObject());
- m_context->bindBuffer(GraphicsContext3D::ELEMENT_ARRAY_BUFFER, m_mesh->elementsBufferObject());
+ m_context->bindBuffer(GL_ARRAY_BUFFER, m_mesh->verticesBufferObject());
+ m_context->bindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_mesh->elementsBufferObject());
bindVertexAttribute(m_compiledProgram->positionAttribLocation(), PositionAttribSize, PositionAttribOffset);
bindVertexAttribute(m_compiledProgram->texAttribLocation(), TexAttribSize, TexAttribOffset);

Powered by Google App Engine
This is Rietveld 408576698