summaryrefslogtreecommitdiff
path: root/libs/hwui/OpenGLRenderer.cpp
diff options
context:
space:
mode:
author Chris Craik <ccraik@google.com> 2015-02-27 17:04:20 -0800
committer Chris Craik <ccraik@google.com> 2015-02-27 17:09:02 -0800
commit083e733e8223a7d416d6c139f318e61864b28ad6 (patch)
tree8f5c0e4faf6cf4e6649319b96706286b68e5763d /libs/hwui/OpenGLRenderer.cpp
parent6b109c74982033d4a220cd10a0eab8b024b351c9 (diff)
Cleanup of FontRenderer
Remove invalid and over complicated buffer unbinding optimization, and simplify constructor. Change-Id: I3dd90528de4f377e972bbd7967e7e232875387e4
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index cef3326d1c02..dd5c49fc9c3f 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1169,7 +1169,7 @@ void OpenGLRenderer::drawRegionRects(const SkRegion& region, const SkPaint& pain
}
void OpenGLRenderer::dirtyLayer(const float left, const float top,
- const float right, const float bottom, const mat4 transform) {
+ const float right, const float bottom, const Matrix4& transform) {
if (hasLayer()) {
Rect bounds(left, top, right, bottom);
transform.mapRect(bounds);
@@ -2805,16 +2805,11 @@ void OpenGLRenderer::drawPosText(const char* text, int bytesCount, int count,
TextSetupFunctor functor(this, x, y, pureTranslate, alpha, mode, paint);
if (fontRenderer.renderPosText(paint, &clip, text, 0, bytesCount, count, x, y,
- positions, hasActiveLayer ? &bounds : nullptr, &functor)) {
- if (hasActiveLayer) {
- if (!pureTranslate) {
- currentTransform()->mapRect(bounds);
- }
- dirtyLayerUnchecked(bounds, getRegion());
- }
+ positions, hasLayer() ? &bounds : nullptr, &functor)) {
+ dirtyLayer(bounds.left, bounds.top, bounds.right, bounds.bottom, *currentTransform());
+ mDirty = true;
}
- mDirty = true;
}
bool OpenGLRenderer::findBestFontTransform(const mat4& transform, SkMatrix* outMatrix) const {
@@ -3011,13 +3006,9 @@ void OpenGLRenderer::drawTextOnPath(const char* text, int bytesCount, int count,
if (fontRenderer.renderTextOnPath(paint, clip, text, 0, bytesCount, count, path,
hOffset, vOffset, hasActiveLayer ? &bounds : nullptr, &functor)) {
- if (hasActiveLayer) {
- currentTransform()->mapRect(bounds);
- dirtyLayerUnchecked(bounds, getRegion());
- }
+ dirtyLayer(bounds.left, bounds.top, bounds.right, bounds.bottom, *currentTransform());
+ mDirty = true;
}
-
- mDirty = true;
}
void OpenGLRenderer::drawPath(const SkPath* path, const SkPaint* paint) {
@@ -3109,11 +3100,9 @@ void OpenGLRenderer::drawLayer(Layer* layer, float x, float y) {
x + layer->layer.getWidth(), y + layer->layer.getHeight());
}
-
TextureVertex* mesh = &layer->mesh[0];
GLsizei elementsCount = layer->meshElementCount;
-
while (elementsCount > 0) {
GLsizei drawCount = MathUtils::min(elementsCount, (GLsizei) kMaxNumberOfQuads * 6);