Loading libs/hwui/DisplayListOp.h +9 −5 Original line number Diff line number Diff line Loading @@ -1548,14 +1548,16 @@ private: }; /** * Not a canvas operation, used only by 3d / z ordering logic in DisplayList::iterate() * Not a canvas operation, used only by 3d / z ordering logic in RenderNode::iterate() */ class DrawShadowOp : public DrawOp { public: DrawShadowOp(const mat4& transformXY, const mat4& transformZ, float alpha, DrawShadowOp(const mat4& transformXY, const mat4& transformZ, float casterAlpha, bool casterUnclipped, float fallbackWidth, float fallbackHeight, const SkPath* outline, const SkPath* revealClip) : DrawOp(NULL), mTransformXY(transformXY), mTransformZ(transformZ), mAlpha(alpha), : DrawOp(NULL), mTransformXY(transformXY), mTransformZ(transformZ), mCasterAlpha(casterAlpha), mCasterUnclipped(casterUnclipped), mFallbackWidth(fallbackWidth), mFallbackHeight(fallbackHeight), mOutline(outline), mRevealClip(revealClip) {} Loading @@ -1572,7 +1574,8 @@ public: Op(casterPerimeter, *mRevealClip, kIntersect_PathOp, &casterPerimeter); } return renderer.drawShadow(mTransformXY, mTransformZ, mAlpha, &casterPerimeter); return renderer.drawShadow(mTransformXY, mTransformZ, mCasterAlpha, mCasterUnclipped, &casterPerimeter); } virtual void output(int level, uint32_t logFlags) const { Loading @@ -1584,7 +1587,8 @@ public: private: const mat4 mTransformXY; const mat4 mTransformZ; const float mAlpha; const float mCasterAlpha; const bool mCasterUnclipped; const float mFallbackWidth; const float mFallbackHeight; Loading libs/hwui/OpenGLRenderer.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -3203,7 +3203,7 @@ static void mapPointFakeZ(Vector3& point, const mat4& transformXY, const mat4& t } status_t OpenGLRenderer::drawShadow(const mat4& casterTransformXY, const mat4& casterTransformZ, float casterAlpha, const SkPath* casterPerimeter) { float casterAlpha, bool casterUnclipped, const SkPath* casterPerimeter) { if (currentSnapshot()->isIgnored()) return DrawGlInfo::kStatusDone; // TODO: use quickRejectWithScissor. For now, always force enable scissor. Loading Loading @@ -3260,7 +3260,7 @@ status_t OpenGLRenderer::drawShadow(const mat4& casterTransformXY, const mat4& c Rect casterBounds(casterPerimeter->getBounds()); casterTransformXY.mapRect(casterBounds); bool isCasterOpaque = (casterAlpha == 1.0f); bool isCasterOpaque = (casterAlpha == 1.0f) && casterUnclipped; // draw caster's shadows if (mCaches.propertyAmbientShadowStrength > 0) { paint.setARGB(casterAlpha * mCaches.propertyAmbientShadowStrength, 0, 0, 0); Loading libs/hwui/OpenGLRenderer.h +1 −1 Original line number Diff line number Diff line Loading @@ -210,7 +210,7 @@ public: virtual status_t drawRects(const float* rects, int count, const SkPaint* paint); status_t drawShadow(const mat4& casterTransformXY, const mat4& casterTransformZ, float casterAlpha, const SkPath* casterPerimeter); float casterAlpha, bool casterUnclipped, const SkPath* casterPerimeter); virtual void resetShader(); virtual void setupShader(SkiaShader* shader); Loading libs/hwui/RenderNode.cpp +10 −1 Original line number Diff line number Diff line Loading @@ -433,8 +433,17 @@ void RenderNode::iterate3dChildren(const Vector<ZDrawDisplayListOpPair>& zTransl const SkPath* revealClipPath = revealClip.hasConvexClip() ? revealClip.getPath() : NULL; // only pass the reveal clip's path if it's convex /** * The drawing area of the caster is always the same as the its perimeter (which * the shadow system uses) *except* in the inverse clip case. Inform the shadow * system that the caster's drawing area (as opposed to its perimeter) has been * clipped, so that it knows the caster can't be opaque. */ bool casterUnclipped = !revealClip.willClip() || revealClip.hasConvexClip(); DisplayListOp* shadowOp = new (alloc) DrawShadowOp( shadowMatrixXY, shadowMatrixZ, caster->properties().getAlpha(), shadowMatrixXY, shadowMatrixZ, caster->properties().getAlpha(), casterUnclipped, caster->properties().getWidth(), caster->properties().getHeight(), outlinePath, revealClipPath); handler(shadowOp, PROPERTY_SAVECOUNT, properties().getClipToBounds()); Loading Loading
libs/hwui/DisplayListOp.h +9 −5 Original line number Diff line number Diff line Loading @@ -1548,14 +1548,16 @@ private: }; /** * Not a canvas operation, used only by 3d / z ordering logic in DisplayList::iterate() * Not a canvas operation, used only by 3d / z ordering logic in RenderNode::iterate() */ class DrawShadowOp : public DrawOp { public: DrawShadowOp(const mat4& transformXY, const mat4& transformZ, float alpha, DrawShadowOp(const mat4& transformXY, const mat4& transformZ, float casterAlpha, bool casterUnclipped, float fallbackWidth, float fallbackHeight, const SkPath* outline, const SkPath* revealClip) : DrawOp(NULL), mTransformXY(transformXY), mTransformZ(transformZ), mAlpha(alpha), : DrawOp(NULL), mTransformXY(transformXY), mTransformZ(transformZ), mCasterAlpha(casterAlpha), mCasterUnclipped(casterUnclipped), mFallbackWidth(fallbackWidth), mFallbackHeight(fallbackHeight), mOutline(outline), mRevealClip(revealClip) {} Loading @@ -1572,7 +1574,8 @@ public: Op(casterPerimeter, *mRevealClip, kIntersect_PathOp, &casterPerimeter); } return renderer.drawShadow(mTransformXY, mTransformZ, mAlpha, &casterPerimeter); return renderer.drawShadow(mTransformXY, mTransformZ, mCasterAlpha, mCasterUnclipped, &casterPerimeter); } virtual void output(int level, uint32_t logFlags) const { Loading @@ -1584,7 +1587,8 @@ public: private: const mat4 mTransformXY; const mat4 mTransformZ; const float mAlpha; const float mCasterAlpha; const bool mCasterUnclipped; const float mFallbackWidth; const float mFallbackHeight; Loading
libs/hwui/OpenGLRenderer.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -3203,7 +3203,7 @@ static void mapPointFakeZ(Vector3& point, const mat4& transformXY, const mat4& t } status_t OpenGLRenderer::drawShadow(const mat4& casterTransformXY, const mat4& casterTransformZ, float casterAlpha, const SkPath* casterPerimeter) { float casterAlpha, bool casterUnclipped, const SkPath* casterPerimeter) { if (currentSnapshot()->isIgnored()) return DrawGlInfo::kStatusDone; // TODO: use quickRejectWithScissor. For now, always force enable scissor. Loading Loading @@ -3260,7 +3260,7 @@ status_t OpenGLRenderer::drawShadow(const mat4& casterTransformXY, const mat4& c Rect casterBounds(casterPerimeter->getBounds()); casterTransformXY.mapRect(casterBounds); bool isCasterOpaque = (casterAlpha == 1.0f); bool isCasterOpaque = (casterAlpha == 1.0f) && casterUnclipped; // draw caster's shadows if (mCaches.propertyAmbientShadowStrength > 0) { paint.setARGB(casterAlpha * mCaches.propertyAmbientShadowStrength, 0, 0, 0); Loading
libs/hwui/OpenGLRenderer.h +1 −1 Original line number Diff line number Diff line Loading @@ -210,7 +210,7 @@ public: virtual status_t drawRects(const float* rects, int count, const SkPaint* paint); status_t drawShadow(const mat4& casterTransformXY, const mat4& casterTransformZ, float casterAlpha, const SkPath* casterPerimeter); float casterAlpha, bool casterUnclipped, const SkPath* casterPerimeter); virtual void resetShader(); virtual void setupShader(SkiaShader* shader); Loading
libs/hwui/RenderNode.cpp +10 −1 Original line number Diff line number Diff line Loading @@ -433,8 +433,17 @@ void RenderNode::iterate3dChildren(const Vector<ZDrawDisplayListOpPair>& zTransl const SkPath* revealClipPath = revealClip.hasConvexClip() ? revealClip.getPath() : NULL; // only pass the reveal clip's path if it's convex /** * The drawing area of the caster is always the same as the its perimeter (which * the shadow system uses) *except* in the inverse clip case. Inform the shadow * system that the caster's drawing area (as opposed to its perimeter) has been * clipped, so that it knows the caster can't be opaque. */ bool casterUnclipped = !revealClip.willClip() || revealClip.hasConvexClip(); DisplayListOp* shadowOp = new (alloc) DrawShadowOp( shadowMatrixXY, shadowMatrixZ, caster->properties().getAlpha(), shadowMatrixXY, shadowMatrixZ, caster->properties().getAlpha(), casterUnclipped, caster->properties().getWidth(), caster->properties().getHeight(), outlinePath, revealClipPath); handler(shadowOp, PROPERTY_SAVECOUNT, properties().getClipToBounds()); Loading