summaryrefslogtreecommitdiff
path: root/libs/hwui/RenderProperties.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/RenderProperties.h')
-rw-r--r--libs/hwui/RenderProperties.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/libs/hwui/RenderProperties.h b/libs/hwui/RenderProperties.h
index 6470d4c16130..04379ae68a0d 100644
--- a/libs/hwui/RenderProperties.h
+++ b/libs/hwui/RenderProperties.h
@@ -16,7 +16,6 @@
#pragma once
-#include "Caches.h"
#include "DeviceInfo.h"
#include "Outline.h"
#include "Rect.h"
@@ -89,9 +88,7 @@ public:
SkBlendMode xferMode() const { return mMode; }
- bool setColorFilter(SkColorFilter* filter);
-
- SkColorFilter* colorFilter() const { return mColorFilter; }
+ SkColorFilter* getColorFilter() const { return mColorFilter.get(); }
// Sets alpha, xfermode, and colorfilter from an SkPaint
// paint may be NULL, in which case defaults will be set
@@ -105,6 +102,7 @@ private:
LayerProperties();
~LayerProperties();
void reset();
+ bool setColorFilter(SkColorFilter* filter);
// Private since external users should go through properties().effectiveLayerType()
LayerType type() const { return mType; }
@@ -116,7 +114,7 @@ private:
bool mOpaque;
uint8_t mAlpha;
SkBlendMode mMode;
- SkColorFilter* mColorFilter = nullptr;
+ sk_sp<SkColorFilter> mColorFilter;
};
/*
@@ -328,9 +326,7 @@ public:
bool isPivotExplicitlySet() const { return mPrimitiveFields.mPivotExplicitlySet; }
- bool resetPivot() {
- return RP_SET_AND_DIRTY(mPrimitiveFields.mPivotExplicitlySet, false);
- }
+ bool resetPivot() { return RP_SET_AND_DIRTY(mPrimitiveFields.mPivotExplicitlySet, false); }
bool setCameraDistance(float distance) {
if (distance != getCameraDistance()) {
@@ -510,17 +506,13 @@ public:
getOutline().getAlpha() != 0.0f;
}
- SkColor getSpotShadowColor() const {
- return mPrimitiveFields.mSpotShadowColor;
- }
+ SkColor getSpotShadowColor() const { return mPrimitiveFields.mSpotShadowColor; }
bool setSpotShadowColor(SkColor shadowColor) {
return RP_SET(mPrimitiveFields.mSpotShadowColor, shadowColor);
}
- SkColor getAmbientShadowColor() const {
- return mPrimitiveFields.mAmbientShadowColor;
- }
+ SkColor getAmbientShadowColor() const { return mPrimitiveFields.mAmbientShadowColor; }
bool setAmbientShadowColor(SkColor shadowColor) {
return RP_SET(mPrimitiveFields.mAmbientShadowColor, shadowColor);
@@ -543,6 +535,14 @@ public:
return CC_UNLIKELY(promotedToLayer()) ? LayerType::RenderLayer : mLayerProperties.mType;
}
+ bool setAllowForceDark(bool allow) {
+ return RP_SET(mPrimitiveFields.mAllowForceDark, allow);
+ }
+
+ bool getAllowForceDark() const {
+ return mPrimitiveFields.mAllowForceDark;
+ }
+
private:
// Rendering properties
struct PrimitiveFields {
@@ -562,6 +562,7 @@ private:
bool mMatrixOrPivotDirty = false;
bool mProjectBackwards = false;
bool mProjectionReceiver = false;
+ bool mAllowForceDark = true;
Rect mClipBounds;
Outline mOutline;
RevealClip mRevealClip;