summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Caches.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/Caches.cpp')
-rw-r--r--libs/hwui/Caches.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index 57d1a4f..a381a68 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -70,6 +70,7 @@ void Caches::init() {
mCurrentPositionPointer = this;
mCurrentPositionStride = 0;
mCurrentTexCoordsPointer = this;
+ mCurrentPixelBuffer = 0;
mTexCoordsArrayEnabled = false;
@@ -366,6 +367,28 @@ bool Caches::unbindIndicesBuffer() {
}
///////////////////////////////////////////////////////////////////////////////
+// PBO
+///////////////////////////////////////////////////////////////////////////////
+
+bool Caches::bindPixelBuffer(const GLuint buffer) {
+ if (mCurrentPixelBuffer != buffer) {
+ glBindBuffer(GL_PIXEL_UNPACK_BUFFER, buffer);
+ mCurrentPixelBuffer = buffer;
+ return true;
+ }
+ return false;
+}
+
+bool Caches::unbindPixelBuffer() {
+ if (mCurrentPixelBuffer) {
+ glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
+ mCurrentPixelBuffer = 0;
+ return true;
+ }
+ return false;
+}
+
+///////////////////////////////////////////////////////////////////////////////
// Meshes and textures
///////////////////////////////////////////////////////////////////////////////