diff options
Diffstat (limited to 'libs/hwui/renderthread')
| -rw-r--r-- | libs/hwui/renderthread/CanvasContext.cpp | 9 | ||||
| -rw-r--r-- | libs/hwui/renderthread/CanvasContext.h | 3 | ||||
| -rw-r--r-- | libs/hwui/renderthread/RenderProxy.cpp | 22 | ||||
| -rw-r--r-- | libs/hwui/renderthread/RenderProxy.h | 3 |
4 files changed, 27 insertions, 10 deletions
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index 6d7dcf1..8329cd4 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -127,10 +127,15 @@ bool CanvasContext::pauseSurface(ANativeWindow* window) { } // TODO: don't pass viewport size, it's automatic via EGL -void CanvasContext::setup(int width, int height, const Vector3& lightCenter, float lightRadius, +void CanvasContext::setup(int width, int height, float lightRadius, uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha) { if (!mCanvas) return; - mCanvas->initLight(lightCenter, lightRadius, ambientShadowAlpha, spotShadowAlpha); + mCanvas->initLight(lightRadius, ambientShadowAlpha, spotShadowAlpha); +} + +void CanvasContext::setLightCenter(const Vector3& lightCenter) { + if (!mCanvas) return; + mCanvas->setLightCenter(lightCenter); } void CanvasContext::setOpaque(bool opaque) { diff --git a/libs/hwui/renderthread/CanvasContext.h b/libs/hwui/renderthread/CanvasContext.h index 8d54304..17917af 100644 --- a/libs/hwui/renderthread/CanvasContext.h +++ b/libs/hwui/renderthread/CanvasContext.h @@ -72,8 +72,9 @@ public: bool pauseSurface(ANativeWindow* window); bool hasSurface() { return mNativeWindow.get(); } - void setup(int width, int height, const Vector3& lightCenter, float lightRadius, + void setup(int width, int height, float lightRadius, uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha); + void setLightCenter(const Vector3& lightCenter); void setOpaque(bool opaque); void makeCurrent(); void processLayerUpdate(DeferredLayerUpdater* layerUpdater); diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp index 17e47b9..d8a9921 100644 --- a/libs/hwui/renderthread/RenderProxy.cpp +++ b/libs/hwui/renderthread/RenderProxy.cpp @@ -172,27 +172,37 @@ bool RenderProxy::pauseSurface(const sp<ANativeWindow>& window) { return (bool) postAndWait(task); } -CREATE_BRIDGE7(setup, CanvasContext* context, int width, int height, - Vector3 lightCenter, float lightRadius, - uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha) { - args->context->setup(args->width, args->height, args->lightCenter, args->lightRadius, +CREATE_BRIDGE6(setup, CanvasContext* context, int width, int height, + float lightRadius, uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha) { + args->context->setup(args->width, args->height, args->lightRadius, args->ambientShadowAlpha, args->spotShadowAlpha); return nullptr; } -void RenderProxy::setup(int width, int height, const Vector3& lightCenter, float lightRadius, +void RenderProxy::setup(int width, int height, float lightRadius, uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha) { SETUP_TASK(setup); args->context = mContext; args->width = width; args->height = height; - args->lightCenter = lightCenter; args->lightRadius = lightRadius; args->ambientShadowAlpha = ambientShadowAlpha; args->spotShadowAlpha = spotShadowAlpha; post(task); } +CREATE_BRIDGE2(setLightCenter, CanvasContext* context, Vector3 lightCenter) { + args->context->setLightCenter(args->lightCenter); + return nullptr; +} + +void RenderProxy::setLightCenter(const Vector3& lightCenter) { + SETUP_TASK(setLightCenter); + args->context = mContext; + args->lightCenter = lightCenter; + post(task); +} + CREATE_BRIDGE2(setOpaque, CanvasContext* context, bool opaque) { args->context->setOpaque(args->opaque); return nullptr; diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h index 31456cd..5febbe0 100644 --- a/libs/hwui/renderthread/RenderProxy.h +++ b/libs/hwui/renderthread/RenderProxy.h @@ -70,8 +70,9 @@ public: ANDROID_API bool initialize(const sp<ANativeWindow>& window); ANDROID_API void updateSurface(const sp<ANativeWindow>& window); ANDROID_API bool pauseSurface(const sp<ANativeWindow>& window); - ANDROID_API void setup(int width, int height, const Vector3& lightCenter, float lightRadius, + ANDROID_API void setup(int width, int height, float lightRadius, uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha); + ANDROID_API void setLightCenter(const Vector3& lightCenter); ANDROID_API void setOpaque(bool opaque); ANDROID_API int64_t* frameInfo(); ANDROID_API int syncAndDrawFrame(); |
