summaryrefslogtreecommitdiff
path: root/libs/hwui/PixelBuffer.cpp
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2016-01-20 11:09:53 -0800
committer John Reck <jreck@google.com> 2016-01-20 13:16:24 -0800
commit2de7771740ee08fcaff638ec6b2e460bb72fff04 (patch)
treef175efd66cc7f81481bb61f398c3ef2041f72919 /libs/hwui/PixelBuffer.cpp
parent8020313d05f22dc1f8a7a182e6da134db17761ec (diff)
Normalize GL_UNPACK_ALIGNMENT
Several places were setting GL_UNPACK_ALIGNMENT unneccessarily, whereas other places were assuming an unpack alignment of 1. Since we never actually do explicit row-alignment, set GL_UNPACK_ALIGNMENT to 1 at context creation time and never change it Bug: 26584230 Also turns on aggressive glGetError checking to better catch potential problem zones Change-Id: I190c8f0f0494a7f046d5ed769405c75d363be59a
Diffstat (limited to 'libs/hwui/PixelBuffer.cpp')
-rw-r--r--libs/hwui/PixelBuffer.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/libs/hwui/PixelBuffer.cpp b/libs/hwui/PixelBuffer.cpp
index 96247260f0f4..6df994c623f2 100644
--- a/libs/hwui/PixelBuffer.cpp
+++ b/libs/hwui/PixelBuffer.cpp
@@ -20,6 +20,7 @@
#include "Extensions.h"
#include "Properties.h"
#include "renderstate/RenderState.h"
+#include "utils/GLUtils.h"
#include <utils/Log.h>
@@ -112,14 +113,10 @@ uint8_t* GpuPixelBuffer::map(AccessMode mode) {
if (mAccessMode == kAccessMode_None) {
mCaches.pixelBufferState().bind(mBuffer);
mMappedPointer = (uint8_t*) glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, getSize(), mode);
-#if DEBUG_OPENGL
- if (!mMappedPointer) {
- GLenum status = GL_NO_ERROR;
- while ((status = glGetError()) != GL_NO_ERROR) {
- ALOGE("Could not map GPU pixel buffer: 0x%x", status);
- }
+ if (CC_UNLIKELY(!mMappedPointer)) {
+ GLUtils::dumpGLErrors();
+ LOG_ALWAYS_FATAL("Failed to map PBO");
}
-#endif
mAccessMode = mode;
}