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

Unified Diff: src/gpu/gl/GrGLGpu.cpp

Issue 1232173002: Remove GL-specific code from GMs and tests (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Get rid of warning Created 5 years, 5 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 | « src/gpu/gl/GrGLGpu.h ('k') | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 626a72f9362a32ad9887f3eb6bbd26c0b19aefa6..e185ef01a56c11e760b07006c82ef8748b188e4a 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -2379,7 +2379,7 @@ bool GrGLGpu::configToGLFormats(GrPixelConfig config,
bool getSizedInternalFormat,
GrGLenum* internalFormat,
GrGLenum* externalFormat,
- GrGLenum* externalType) {
+ GrGLenum* externalType) const {
GrGLenum dontCare;
if (NULL == internalFormat) {
internalFormat = &dontCare;
@@ -3067,6 +3067,44 @@ void GrGLGpu::didRemoveGpuTraceMarker() {
}
}
+GrBackendObject GrGLGpu::createBackendTexture(void* pixels, int w, int h,
+ GrPixelConfig config) const {
+ GrGLuint texID;
+ GL_CALL(GenTextures(1, &texID));
+ GL_CALL(ActiveTexture(GR_GL_TEXTURE0));
+ GL_CALL(PixelStorei(GR_GL_UNPACK_ALIGNMENT, 1));
+ GL_CALL(BindTexture(GR_GL_TEXTURE_2D, texID));
+ GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_MAG_FILTER, GR_GL_NEAREST));
+ GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_MIN_FILTER, GR_GL_NEAREST));
+ GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_WRAP_S, GR_GL_CLAMP_TO_EDGE));
+ GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_WRAP_T, GR_GL_CLAMP_TO_EDGE));
+
+ GrGLenum internalFormat = 0x0; // suppress warning
+ GrGLenum externalFormat = 0x0; // suppress warning
+ GrGLenum externalType = 0x0; // suppress warning
+
+ this->configToGLFormats(config, false, &internalFormat, &externalFormat, &externalType);
+
+ GL_CALL(TexImage2D(GR_GL_TEXTURE_2D, 0, internalFormat, w, h, 0, externalFormat,
+ externalType, pixels));
+
+ return texID;
+}
+
+bool GrGLGpu::isBackendTexture(GrBackendObject id) const {
+ GrGLuint texID = (GrGLuint)id;
+
+ GrGLboolean result;
+ GL_CALL_RET(result, IsTexture(texID));
+
+ return (GR_GL_TRUE == result);
+}
+
+void GrGLGpu::deleteBackendTexture(GrBackendObject id) const {
+ GrGLuint texID = (GrGLuint)id;
+ GL_CALL(DeleteTextures(1, &texID));
+}
+
///////////////////////////////////////////////////////////////////////////////
GrGLAttribArrayState* GrGLGpu::HWGeometryState::bindArrayAndBuffersToDraw(
GrGLGpu* gpu,
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698