зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1229975 - backport fix for Skia's GrConvexPolyEffect. r=mchang
This commit is contained in:
Родитель
24df5d41a7
Коммит
29341ea574
|
@ -8,6 +8,7 @@
|
|||
#include "GrConvexPolyEffect.h"
|
||||
#include "GrInvariantOutput.h"
|
||||
#include "SkPathPriv.h"
|
||||
#include "effects/GrConstColorProcessor.h"
|
||||
#include "glsl/GrGLSLFragmentProcessor.h"
|
||||
#include "glsl/GrGLSLFragmentShaderBuilder.h"
|
||||
#include "glsl/GrGLSLProgramDataManager.h"
|
||||
|
@ -257,7 +258,16 @@ GrFragmentProcessor* GrConvexPolyEffect::Create(GrPrimitiveEdgeType type, const
|
|||
SkScalar edges[3 * kMaxEdges];
|
||||
|
||||
SkPathPriv::FirstDirection dir;
|
||||
SkAssertResult(SkPathPriv::CheapComputeFirstDirection(path, &dir));
|
||||
// The only way this should fail is if the clip is effectively a infinitely thin line. In that
|
||||
// case nothing is inside the clip. It'd be nice to detect this at a higher level and either
|
||||
// skip the draw or omit the clip element.
|
||||
if (!SkPathPriv::CheapComputeFirstDirection(path, &dir)) {
|
||||
if (GrProcessorEdgeTypeIsInverseFill(type)) {
|
||||
return GrConstColorProcessor::Create(0xFFFFFFFF,
|
||||
GrConstColorProcessor::kModulateRGBA_InputMode);
|
||||
}
|
||||
return GrConstColorProcessor::Create(0, GrConstColorProcessor::kIgnore_InputMode);
|
||||
}
|
||||
|
||||
SkVector t;
|
||||
if (nullptr == offset) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче