summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/FontRenderer.cpp6
-rw-r--r--libs/hwui/OpenGLRenderer.cpp7
-rw-r--r--libs/hwui/OpenGLRenderer.h3
-rw-r--r--libs/hwui/ProgramCache.cpp2
-rw-r--r--libs/hwui/ProgramCache.h2
-rw-r--r--libs/hwui/Rect.h8
6 files changed, 17 insertions, 11 deletions
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp
index 8389e56..1b21aee 100644
--- a/libs/hwui/FontRenderer.cpp
+++ b/libs/hwui/FontRenderer.cpp
@@ -482,9 +482,9 @@ void FontRenderer::initVertexArrayBuffers() {
}
glGenBuffers(1, &mIndexBufferID);
- glBindBuffer(GL_ARRAY_BUFFER, mIndexBufferID);
- glBufferData(GL_ARRAY_BUFFER, indexBufferSizeBytes, indexBufferData, GL_DYNAMIC_DRAW);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mIndexBufferID);
+ glBufferData(GL_ELEMENT_ARRAY_BUFFER, indexBufferSizeBytes, indexBufferData, GL_STATIC_DRAW);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
free(indexBufferData);
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 92875b1..2876010 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -455,7 +455,7 @@ bool OpenGLRenderer::createLayer(sp<Snapshot> snapshot, float left, float top,
#endif
// Clear the FBO
- glScissor(0.0f, 0.0f, bounds.getWidth(), bounds.getHeight());
+ glScissor(0.0f, 0.0f, bounds.getWidth() + 1.0f, bounds.getHeight() + 1.0f);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);
@@ -585,7 +585,10 @@ void OpenGLRenderer::setMatrix(SkMatrix* matrix) {
}
const float* OpenGLRenderer::getMatrix() const {
- return &mSnapshot->transform->data[0];
+ if (mSnapshot->fbo != 0) {
+ return &mSnapshot->transform->data[0];
+ }
+ return &mIdentity.data[0];
}
void OpenGLRenderer::getMatrix(SkMatrix* matrix) {
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index f8828e2..423614b 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -432,6 +432,9 @@ private:
// Misc
GLint mMaxTextureSize;
+ // Indentity matrix
+ const mat4 mIdentity;
+
friend class DisplayListRenderer;
}; // class OpenGLRenderer
diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp
index 1eac239..3cd85c8 100644
--- a/libs/hwui/ProgramCache.cpp
+++ b/libs/hwui/ProgramCache.cpp
@@ -417,7 +417,7 @@ String8 ProgramCache::generateFragmentShader(const ProgramDescription& descripti
}
// Optimization for common cases
- if (!blendFramebuffer) {
+ if (!blendFramebuffer && description.colorOp == ProgramDescription::kColorNone) {
bool fast = false;
const bool noShader = !description.hasGradient && !description.hasBitmap;
diff --git a/libs/hwui/ProgramCache.h b/libs/hwui/ProgramCache.h
index ec9851e..9cb13b3 100644
--- a/libs/hwui/ProgramCache.h
+++ b/libs/hwui/ProgramCache.h
@@ -135,7 +135,7 @@ struct ProgramDescription {
GLenum bitmapWrapT;
// Color operations
- int colorOp;
+ ColorModifier colorOp;
SkXfermode::Mode colorMode;
// Framebuffer blending (requires Extensions.hasFramebufferFetch())
diff --git a/libs/hwui/Rect.h b/libs/hwui/Rect.h
index f03a602..c571ea1 100644
--- a/libs/hwui/Rect.h
+++ b/libs/hwui/Rect.h
@@ -149,10 +149,10 @@ struct Rect {
}
void snapToPixelBoundaries() {
- left = floor(left);
- top = floor(top);
- right = ceil(right);
- bottom = ceil(bottom);
+ left = floorf(left);
+ top = floorf(top);
+ right = ceilf(right);
+ bottom = ceilf(bottom);
}
void dump() const {