Loading libs/hwui/OpenGLRenderer.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -3201,8 +3201,8 @@ status_t OpenGLRenderer::drawShadow(const mat4& casterTransform, float casterAlp VertexBuffer spotShadowVertexBuffer; VertexBuffer spotShadowVertexBuffer; ShadowTessellator::tessellateSpotShadow(width, height, ShadowTessellator::tessellateSpotShadow(width, height, getWidth(), getHeight(), casterTransform, *currentTransform(), getWidth(), getHeight(), spotShadowVertexBuffer); casterTransform, spotShadowVertexBuffer); drawVertexBuffer(spotShadowVertexBuffer, &paint); drawVertexBuffer(spotShadowVertexBuffer, &paint); return DrawGlInfo::kStatusDrew; return DrawGlInfo::kStatusDrew; Loading libs/hwui/ShadowTessellator.cpp +8 −1 Original line number Original line Diff line number Diff line Loading @@ -90,7 +90,7 @@ void ShadowTessellator::tessellateAmbientShadow(float width, float height, } } void ShadowTessellator::tessellateSpotShadow(float width, float height, void ShadowTessellator::tessellateSpotShadow(float width, float height, int screenWidth, int screenHeight, const mat4& receiverTransform, int screenWidth, int screenHeight, const mat4& casterTransform, VertexBuffer& shadowVertexBuffer) { const mat4& casterTransform, VertexBuffer& shadowVertexBuffer) { const int vertexCount = 4; const int vertexCount = 4; Vector3 polygon[vertexCount]; Vector3 polygon[vertexCount]; Loading @@ -106,6 +106,13 @@ void ShadowTessellator::tessellateSpotShadow(float width, float height, #if DEBUG_SHADOW #if DEBUG_SHADOW ALOGD("light center %f %f %f", lightCenter.x, lightCenter.y, lightCenter.z); ALOGD("light center %f %f %f", lightCenter.x, lightCenter.y, lightCenter.z); #endif #endif // light position (because it's in local space) needs to compensate for receiver transform // TODO: should apply to light orientation, not just position Matrix4 reverseReceiverTransform; reverseReceiverTransform.loadInverse(receiverTransform); reverseReceiverTransform.mapPoint3d(lightCenter); const float lightSize = maximal / 8; const float lightSize = maximal / 8; const int lightVertexCount = 16; const int lightVertexCount = 16; Loading libs/hwui/ShadowTessellator.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -30,7 +30,7 @@ public: const mat4& casterTransform, VertexBuffer& shadowVertexBuffer); const mat4& casterTransform, VertexBuffer& shadowVertexBuffer); static void tessellateSpotShadow(float width, float height, static void tessellateSpotShadow(float width, float height, int screenWidth, int screenHeight, const mat4& receiverTransform, int screenWidth, int screenHeight, const mat4& casterTransform, VertexBuffer& shadowVertexBuffer); const mat4& casterTransform, VertexBuffer& shadowVertexBuffer); private: private: Loading Loading
libs/hwui/OpenGLRenderer.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -3201,8 +3201,8 @@ status_t OpenGLRenderer::drawShadow(const mat4& casterTransform, float casterAlp VertexBuffer spotShadowVertexBuffer; VertexBuffer spotShadowVertexBuffer; ShadowTessellator::tessellateSpotShadow(width, height, ShadowTessellator::tessellateSpotShadow(width, height, getWidth(), getHeight(), casterTransform, *currentTransform(), getWidth(), getHeight(), spotShadowVertexBuffer); casterTransform, spotShadowVertexBuffer); drawVertexBuffer(spotShadowVertexBuffer, &paint); drawVertexBuffer(spotShadowVertexBuffer, &paint); return DrawGlInfo::kStatusDrew; return DrawGlInfo::kStatusDrew; Loading
libs/hwui/ShadowTessellator.cpp +8 −1 Original line number Original line Diff line number Diff line Loading @@ -90,7 +90,7 @@ void ShadowTessellator::tessellateAmbientShadow(float width, float height, } } void ShadowTessellator::tessellateSpotShadow(float width, float height, void ShadowTessellator::tessellateSpotShadow(float width, float height, int screenWidth, int screenHeight, const mat4& receiverTransform, int screenWidth, int screenHeight, const mat4& casterTransform, VertexBuffer& shadowVertexBuffer) { const mat4& casterTransform, VertexBuffer& shadowVertexBuffer) { const int vertexCount = 4; const int vertexCount = 4; Vector3 polygon[vertexCount]; Vector3 polygon[vertexCount]; Loading @@ -106,6 +106,13 @@ void ShadowTessellator::tessellateSpotShadow(float width, float height, #if DEBUG_SHADOW #if DEBUG_SHADOW ALOGD("light center %f %f %f", lightCenter.x, lightCenter.y, lightCenter.z); ALOGD("light center %f %f %f", lightCenter.x, lightCenter.y, lightCenter.z); #endif #endif // light position (because it's in local space) needs to compensate for receiver transform // TODO: should apply to light orientation, not just position Matrix4 reverseReceiverTransform; reverseReceiverTransform.loadInverse(receiverTransform); reverseReceiverTransform.mapPoint3d(lightCenter); const float lightSize = maximal / 8; const float lightSize = maximal / 8; const int lightVertexCount = 16; const int lightVertexCount = 16; Loading
libs/hwui/ShadowTessellator.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -30,7 +30,7 @@ public: const mat4& casterTransform, VertexBuffer& shadowVertexBuffer); const mat4& casterTransform, VertexBuffer& shadowVertexBuffer); static void tessellateSpotShadow(float width, float height, static void tessellateSpotShadow(float width, float height, int screenWidth, int screenHeight, const mat4& receiverTransform, int screenWidth, int screenHeight, const mat4& casterTransform, VertexBuffer& shadowVertexBuffer); const mat4& casterTransform, VertexBuffer& shadowVertexBuffer); private: private: Loading