Merge "Disable blending for opaque TextureView" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
5a3b666ab0
@@ -72,5 +72,13 @@ void GlLayer::generateTexture() {
|
||||
}
|
||||
}
|
||||
|
||||
SkBlendMode GlLayer::getMode() const {
|
||||
if (texture.blend || mode != SkBlendMode::kSrcOver) {
|
||||
return mode;
|
||||
} else {
|
||||
return SkBlendMode::kSrc;
|
||||
}
|
||||
}
|
||||
|
||||
}; // namespace uirenderer
|
||||
}; // namespace android
|
||||
|
||||
@@ -66,6 +66,8 @@ public:
|
||||
*/
|
||||
void onGlContextLost();
|
||||
|
||||
SkBlendMode getMode() const override;
|
||||
|
||||
private:
|
||||
Caches& caches;
|
||||
|
||||
|
||||
@@ -27,10 +27,10 @@ Layer::Layer(RenderState& renderState, Api api, sk_sp<SkColorFilter> colorFilter
|
||||
SkBlendMode mode)
|
||||
: GpuMemoryTracker(GpuObjectType::Layer)
|
||||
, mRenderState(renderState)
|
||||
, mode(mode)
|
||||
, mApi(api)
|
||||
, mColorFilter(colorFilter)
|
||||
, alpha(alpha)
|
||||
, mode(mode) {
|
||||
, alpha(alpha) {
|
||||
// TODO: This is a violation of Android's typical ref counting, but it
|
||||
// preserves the old inc/dec ref locations. This should be changed...
|
||||
incStrong(nullptr);
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
|
||||
inline int getAlpha() const { return alpha; }
|
||||
|
||||
inline SkBlendMode getMode() const { return mode; }
|
||||
virtual SkBlendMode getMode() const { return mode; }
|
||||
|
||||
inline SkColorFilter* getColorFilter() const { return mColorFilter.get(); }
|
||||
|
||||
@@ -109,6 +109,11 @@ protected:
|
||||
|
||||
RenderState& mRenderState;
|
||||
|
||||
/**
|
||||
* Blending mode of the layer.
|
||||
*/
|
||||
SkBlendMode mode;
|
||||
|
||||
private:
|
||||
void buildColorSpaceWithFilter();
|
||||
|
||||
@@ -139,11 +144,6 @@ private:
|
||||
*/
|
||||
int alpha;
|
||||
|
||||
/**
|
||||
* Blending mode of the layer.
|
||||
*/
|
||||
SkBlendMode mode;
|
||||
|
||||
/**
|
||||
* Optional texture coordinates transform.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user