am 59e129fb
: Merge "Account for colorfilter transparency in determining paint opacity" into lmp-mr1-dev
* commit '59e129fbc8a70d58d124ccc309661719f562b486': Account for colorfilter transparency in determining paint opacity
This commit is contained in:
@ -212,10 +212,13 @@ protected:
|
||||
|
||||
// check state/paint for transparency
|
||||
if (mPaint) {
|
||||
if (mPaint->getAlpha() != 0xFF) {
|
||||
return false;
|
||||
}
|
||||
if (mPaint->getShader() && !mPaint->getShader()->isOpaque()) {
|
||||
return false;
|
||||
}
|
||||
if (mPaint->getAlpha() != 0xFF) {
|
||||
if (Renderer::isBlendedColorFilter(mPaint->getColorFilter())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1734,13 +1734,6 @@ void OpenGLRenderer::accountForClear(SkXfermode::Mode mode) {
|
||||
}
|
||||
}
|
||||
|
||||
static bool isBlendedColorFilter(const SkColorFilter* filter) {
|
||||
if (filter == NULL) {
|
||||
return false;
|
||||
}
|
||||
return (filter->getFlags() & SkColorFilter::kAlphaUnchanged_Flag) == 0;
|
||||
}
|
||||
|
||||
void OpenGLRenderer::setupDrawBlending(const Layer* layer, bool swapSrcDst) {
|
||||
SkXfermode::Mode mode = layer->getMode();
|
||||
// When the blending mode is kClear_Mode, we need to use a modulate color
|
||||
|
@ -17,12 +17,13 @@
|
||||
#ifndef ANDROID_HWUI_RENDERER_H
|
||||
#define ANDROID_HWUI_RENDERER_H
|
||||
|
||||
#include <SkColorFilter.h>
|
||||
#include <SkPaint.h>
|
||||
#include <SkRegion.h>
|
||||
|
||||
#include <utils/String8.h>
|
||||
|
||||
#include "AssetAtlas.h"
|
||||
#include "SkPaint.h"
|
||||
|
||||
namespace android {
|
||||
|
||||
@ -81,6 +82,14 @@ public:
|
||||
&& !paint.getColorFilter()
|
||||
&& getXfermode(paint.getXfermode()) == SkXfermode::kSrcOver_Mode;
|
||||
}
|
||||
|
||||
static bool isBlendedColorFilter(const SkColorFilter* filter) {
|
||||
if (filter == NULL) {
|
||||
return false;
|
||||
}
|
||||
return (filter->getFlags() & SkColorFilter::kAlphaUnchanged_Flag) == 0;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Frame state operations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user