diff options
author | 2014-02-11 11:46:49 -0500 | |
---|---|---|
committer | 2014-02-12 11:26:06 -0500 | |
commit | e889298cd6ae1fc0d76bc00d7d12586db03eb261 (patch) | |
tree | a2f5114d1ea5ff1265e28e2b01b4750d5d2741f3 /libs/hwui/OpenGLRenderer.cpp | |
parent | 826e51c4da2beac50c0ed1e1359787a0b69c878c (diff) |
Refactor setting an SkPaint onto a hwui Layer.
This CL removes the unecessary JNI call to set the colorFilter on
a layer.
Change-Id: I9e088f888938d4315745aa618334bfdb9e61343a
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index fee916b25369..0a83332dad95 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -868,14 +868,11 @@ bool OpenGLRenderer::createLayer(float left, float top, float right, float botto const bool fboLayer = flags & SkCanvas::kClipToLayer_SaveFlag; - SkXfermode::Mode mode = getXfermodeDirect(paint); - int alpha = getAlphaDirect(paint); - // Window coordinates of the layer Rect clip; Rect bounds(left, top, right, bottom); calculateLayerBoundsAndClip(bounds, clip, fboLayer); - updateSnapshotIgnoreForLayer(bounds, clip, fboLayer, alpha); + updateSnapshotIgnoreForLayer(bounds, clip, fboLayer, getAlphaDirect(paint)); // Bail out if we won't draw in this snapshot if (currentSnapshot()->isIgnored()) { @@ -888,12 +885,11 @@ bool OpenGLRenderer::createLayer(float left, float top, float right, float botto return false; } - layer->setAlpha(alpha, mode); + layer->setPaint(paint); layer->layer.set(bounds); layer->texCoords.set(0.0f, bounds.getHeight() / float(layer->getHeight()), bounds.getWidth() / float(layer->getWidth()), 0.0f); - layer->setColorFilter(getColorFilter(paint)); layer->setBlend(true); layer->setDirty(false); @@ -1011,7 +1007,6 @@ void OpenGLRenderer::composeLayer(const Snapshot& removed, const Snapshot& resto } if (!fboLayer && layer->getAlpha() < 255) { - // TODO: this seems to point to the fact that the layer should store the paint SkPaint layerPaint; layerPaint.setAlpha(layer->getAlpha()); layerPaint.setXfermodeMode(SkXfermode::kDstIn_Mode); |