diff options
| author | 2011-01-13 12:13:59 -0800 | |
|---|---|---|
| committer | 2011-01-13 12:13:59 -0800 | |
| commit | c15c7a79a69733bd21d6548fd74c2874fdabe7e8 (patch) | |
| tree | e5731b92e59095b16ec0af101963f39d08db69b6 /libs/hwui/OpenGLRenderer.cpp | |
| parent | 5865c494a571a7e164218857d3b860004c50baf6 (diff) | |
| parent | ada830f639591b99c3e40de22b07296c7932a33f (diff) | |
Merge "Cleanup implementation of hardware layers." into honeycomb
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
| -rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 9beb227c9b0c..7f7deec90a1b 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -622,10 +622,12 @@ void OpenGLRenderer::composeLayerRegion(Layer* layer, const Rect& rect) { setupDraw(); setupDrawWithTexture(); setupDrawColor(alpha, alpha, alpha, alpha); + setupDrawColorFilter(); setupDrawBlending(layer->blend || layer->alpha < 255, layer->mode, false); setupDrawProgram(); setupDrawDirtyRegionsDisabled(); setupDrawPureColorUniforms(); + setupDrawColorFilterUniforms(); setupDrawTexture(layer->texture); setupDrawModelViewTranslate(rect.left, rect.top, rect.right, rect.bottom); setupDrawMesh(&mesh[0].position[0], &mesh[0].texture[0]); @@ -1485,28 +1487,22 @@ void OpenGLRenderer::drawPath(SkPath* path, SkPaint* paint) { finishDrawTexture(); } -void OpenGLRenderer::drawLayer(int texture, float left, float top, float right, float bottom, - float u, float v, SkPaint* paint) { - if (quickReject(left, top, right, bottom)) { +void OpenGLRenderer::drawLayer(Layer* layer, float x, float y, SkPaint* paint) { + if (!layer || quickReject(x, y, x + layer->layer.getWidth(), y + layer->layer.getHeight())) { return; } glActiveTexture(gTextureUnits[0]); - if (!texture) return; - - mCaches.unbindMeshBuffer(); - resetDrawTextureTexCoords(0.0f, v, u, 0.0f); int alpha; SkXfermode::Mode mode; getAlphaAndMode(paint, &alpha, &mode); - // TODO: Should get the blend info from the caller - drawTextureMesh(left, top, right, bottom, texture, alpha / 255.0f, mode, true, - &mMeshVertices[0].position[0], &mMeshVertices[0].texture[0], - GL_TRIANGLE_STRIP, gMeshCount); + layer->alpha = alpha; + layer->mode = mode; - resetDrawTextureTexCoords(0.0f, 0.0f, 1.0f, 1.0f); + const Rect r(x, y, x + layer->layer.getWidth(), y + layer->layer.getHeight()); + composeLayerRect(layer, r); } /////////////////////////////////////////////////////////////////////////////// |