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

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

Issue 1490473003: Add transfer buffer support. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix roll issue Created 5 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
« no previous file with comments | « src/gpu/gl/GrGLVertexBuffer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/SkNullGLContext.cpp
diff --git a/src/gpu/gl/SkNullGLContext.cpp b/src/gpu/gl/SkNullGLContext.cpp
index e2a80ce2b37e72ca6f2c68c85f9a00090c6477b0..e7270c32c47c6283f5d45e4f2be40bb520a0abda 100644
--- a/src/gpu/gl/SkNullGLContext.cpp
+++ b/src/gpu/gl/SkNullGLContext.cpp
@@ -122,6 +122,8 @@ public:
BufferManager fBufferManager;
GrGLuint fCurrArrayBuffer;
GrGLuint fCurrElementArrayBuffer;
+ GrGLuint fCurrPixelPackBuffer;
+ GrGLuint fCurrPixelUnpackBuffer;
GrGLuint fCurrProgramID;
GrGLuint fCurrShaderID;
@@ -129,6 +131,8 @@ public:
ContextState()
: fCurrArrayBuffer(0)
, fCurrElementArrayBuffer(0)
+ , fCurrPixelPackBuffer(0)
+ , fCurrPixelUnpackBuffer(0)
, fCurrProgramID(0)
, fCurrShaderID(0) {}
@@ -172,6 +176,12 @@ GrGLvoid GR_GL_FUNCTION_TYPE nullGLBufferData(GrGLenum target,
case GR_GL_ELEMENT_ARRAY_BUFFER:
id = state->fCurrElementArrayBuffer;
break;
+ case GR_GL_PIXEL_PACK_BUFFER:
+ id = state->fCurrPixelPackBuffer;
+ break;
+ case GR_GL_PIXEL_UNPACK_BUFFER:
+ id = state->fCurrPixelUnpackBuffer;
+ break;
default:
SkFAIL("Unexpected target to nullGLBufferData");
break;
@@ -215,6 +225,12 @@ GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindBuffer(GrGLenum target, GrGLuint buffer)
case GR_GL_ELEMENT_ARRAY_BUFFER:
state->fCurrElementArrayBuffer = buffer;
break;
+ case GR_GL_PIXEL_PACK_BUFFER:
+ state->fCurrPixelPackBuffer = buffer;
+ break;
+ case GR_GL_PIXEL_UNPACK_BUFFER:
+ state->fCurrPixelUnpackBuffer = buffer;
+ break;
}
}
@@ -228,6 +244,12 @@ GrGLvoid GR_GL_FUNCTION_TYPE nullGLDeleteBuffers(GrGLsizei n, const GrGLuint* id
if (ids[i] == state->fCurrElementArrayBuffer) {
state->fCurrElementArrayBuffer = 0;
}
+ if (ids[i] == state->fCurrPixelPackBuffer) {
+ state->fCurrPixelPackBuffer = 0;
+ }
+ if (ids[i] == state->fCurrPixelUnpackBuffer) {
+ state->fCurrPixelUnpackBuffer = 0;
+ }
BufferObj* buffer = state->fBufferManager.lookUp(ids[i]);
state->fBufferManager.free(buffer);
@@ -245,6 +267,12 @@ GrGLvoid* GR_GL_FUNCTION_TYPE nullGLMapBufferRange(GrGLenum target, GrGLintptr o
case GR_GL_ELEMENT_ARRAY_BUFFER:
id = state->fCurrElementArrayBuffer;
break;
+ case GR_GL_PIXEL_PACK_BUFFER:
+ id = state->fCurrPixelPackBuffer;
+ break;
+ case GR_GL_PIXEL_UNPACK_BUFFER:
+ id = state->fCurrPixelUnpackBuffer;
+ break;
}
if (id > 0) {
@@ -267,6 +295,12 @@ GrGLvoid* GR_GL_FUNCTION_TYPE nullGLMapBuffer(GrGLenum target, GrGLenum access)
case GR_GL_ELEMENT_ARRAY_BUFFER:
id = state->fCurrElementArrayBuffer;
break;
+ case GR_GL_PIXEL_PACK_BUFFER:
+ id = state->fCurrPixelPackBuffer;
+ break;
+ case GR_GL_PIXEL_UNPACK_BUFFER:
+ id = state->fCurrPixelUnpackBuffer;
+ break;
}
if (id > 0) {
@@ -295,6 +329,12 @@ GrGLboolean GR_GL_FUNCTION_TYPE nullGLUnmapBuffer(GrGLenum target) {
case GR_GL_ELEMENT_ARRAY_BUFFER:
id = state->fCurrElementArrayBuffer;
break;
+ case GR_GL_PIXEL_PACK_BUFFER:
+ id = state->fCurrPixelPackBuffer;
+ break;
+ case GR_GL_PIXEL_UNPACK_BUFFER:
+ id = state->fCurrPixelUnpackBuffer;
+ break;
}
if (id > 0) {
BufferObj* buffer = state->fBufferManager.lookUp(id);
@@ -320,6 +360,12 @@ GrGLvoid GR_GL_FUNCTION_TYPE nullGLGetBufferParameteriv(GrGLenum target, GrGLenu
case GR_GL_ELEMENT_ARRAY_BUFFER:
id = state->fCurrElementArrayBuffer;
break;
+ case GR_GL_PIXEL_PACK_BUFFER:
+ id = state->fCurrPixelPackBuffer;
+ break;
+ case GR_GL_PIXEL_UNPACK_BUFFER:
+ id = state->fCurrPixelUnpackBuffer;
+ break;
}
if (id > 0) {
BufferObj* buffer = state->fBufferManager.lookUp(id);
« no previous file with comments | « src/gpu/gl/GrGLVertexBuffer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698