summaryrefslogtreecommitdiffstats
path: root/libs/hwui/OpenGLRenderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index e032085..23de3a5 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -24,6 +24,7 @@
#include <SkTypeface.h>
#include <utils/Log.h>
+#include <utils/StopWatch.h>
#include "OpenGLRenderer.h"
@@ -584,8 +585,9 @@ void OpenGLRenderer::drawBitmap(SkBitmap* bitmap,
resetDrawTextureTexCoords(0.0f, 0.0f, 1.0f, 1.0f);
}
-void OpenGLRenderer::drawPatch(SkBitmap* bitmap, Res_png_9patch* patch,
- float left, float top, float right, float bottom, const SkPaint* paint) {
+void OpenGLRenderer::drawPatch(SkBitmap* bitmap, const int32_t* xDivs, const int32_t* yDivs,
+ uint32_t width, uint32_t height, float left, float top, float right, float bottom,
+ const SkPaint* paint) {
if (quickReject(left, top, right, bottom)) {
return;
}
@@ -599,9 +601,9 @@ void OpenGLRenderer::drawPatch(SkBitmap* bitmap, Res_png_9patch* patch,
SkXfermode::Mode mode;
getAlphaAndMode(paint, &alpha, &mode);
- Patch* mesh = mCaches.patchCache.get(patch);
+ Patch* mesh = mCaches.patchCache.get(width, height);
mesh->updateVertices(bitmap->width(), bitmap->height(),left, top, right, bottom,
- &patch->xDivs[0], &patch->yDivs[0], patch->numXDivs, patch->numYDivs);
+ xDivs, yDivs, width, height);
// Specify right and bottom as +1.0f from left/top to prevent scaling since the
// patch mesh already defines the final size
@@ -710,6 +712,7 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count,
if (text == NULL || count == 0 || (paint->getAlpha() == 0 && paint->getXfermode() == NULL)) {
return;
}
+
paint->setAntiAlias(true);
float length = -1.0f;
@@ -739,6 +742,7 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count,
FontRenderer& fontRenderer = mCaches.fontRenderer.getFontRenderer(paint);
fontRenderer.setFont(paint, SkTypeface::UniqueID(paint->getTypeface()),
paint->getTextSize());
+
if (mHasShadow) {
glActiveTexture(gTextureUnits[0]);
mCaches.dropShadowCache.setFontRenderer(fontRenderer);