Log more info for Chrome bug 1132617
Bug: chromium:1132617 Change-Id: I88950bc782a7f0ab4431b1f9646750731c8069f6 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320063 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
This commit is contained in:
parent
314e7e522b
commit
8ff24492e2
@ -13,6 +13,7 @@
|
||||
|
||||
class SkPath;
|
||||
class SkMatrix;
|
||||
class SkString;
|
||||
|
||||
/** \class SkRRect
|
||||
SkRRect describes a rounded rectangle with a bounds and a pair of radii for each corner.
|
||||
@ -475,6 +476,7 @@ public:
|
||||
example: https://fiddle.skia.org/c/@RRect_dump
|
||||
*/
|
||||
void dump(bool asHex) const;
|
||||
SkString dumpToString(bool asHex) const;
|
||||
|
||||
/** Writes text representation of SkRRect to standard output. The representation
|
||||
may be directly compiled as C++ code. Floating point values are written
|
||||
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "include/core/SkMatrix.h"
|
||||
#include "include/core/SkString.h"
|
||||
#include "include/private/SkMalloc.h"
|
||||
#include "src/core/SkBuffer.h"
|
||||
#include "src/core/SkRRectPriv.h"
|
||||
@ -582,7 +583,7 @@ bool SkRRectPriv::ReadFromBuffer(SkRBuffer* buffer, SkRRect* rr) {
|
||||
#include "include/core/SkString.h"
|
||||
#include "src/core/SkStringUtils.h"
|
||||
|
||||
void SkRRect::dump(bool asHex) const {
|
||||
SkString SkRRect::dumpToString(bool asHex) const {
|
||||
SkScalarAsStringType asType = asHex ? kHex_SkScalarAsStringType : kDec_SkScalarAsStringType;
|
||||
|
||||
fRect.dump(asHex);
|
||||
@ -598,9 +599,11 @@ void SkRRect::dump(bool asHex) const {
|
||||
line.append("\n");
|
||||
}
|
||||
line.append("};");
|
||||
SkDebugf("%s\n", line.c_str());
|
||||
return line;
|
||||
}
|
||||
|
||||
void SkRRect::dump(bool asHex) const { SkDebugf("%s\n", this->dumpToString(asHex).c_str()); }
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
|
@ -286,8 +286,15 @@ uniform half blurRadius;
|
||||
float xformedSigma,
|
||||
const SkRRect& srcRRect,
|
||||
const SkRRect& devRRect) {
|
||||
SkASSERT(!SkRRectPriv::IsCircle(devRRect) && !devRRect.isRect()); // Should've been caught up-stream
|
||||
|
||||
// Should've been caught up-stream
|
||||
#ifdef SK_DEBUG
|
||||
SkASSERTF(!SkRRectPriv::IsCircle(devRRect), "Unexpected circle. %d\n\t%s\n\t%s",
|
||||
SkRRectPriv::IsCircle(srcRRect),
|
||||
srcRRect.dumpToString(true).c_str(), devRRect.dumpToString(true).c_str());
|
||||
SkASSERTF(!devRRect.isRect(), "Unexpected rect. %d\n\t%s\n\t%s",
|
||||
srcRRect.isRect(),
|
||||
srcRRect.dumpToString(true).c_str(), devRRect.dumpToString(true).c_str());
|
||||
#endif
|
||||
// TODO: loosen this up
|
||||
if (!SkRRectPriv::IsSimpleCircular(devRRect)) {
|
||||
return nullptr;
|
||||
|
@ -261,9 +261,14 @@ std::unique_ptr<GrFragmentProcessor> GrRRectBlurEffect::Make(
|
||||
float xformedSigma,
|
||||
const SkRRect& srcRRect,
|
||||
const SkRRect& devRRect) {
|
||||
SkASSERT(!SkRRectPriv::IsCircle(devRRect) &&
|
||||
!devRRect.isRect()); // Should've been caught up-stream
|
||||
|
||||
// Should've been caught up-stream
|
||||
#ifdef SK_DEBUG
|
||||
SkASSERTF(!SkRRectPriv::IsCircle(devRRect), "Unexpected circle. %d\n\t%s\n\t%s",
|
||||
SkRRectPriv::IsCircle(srcRRect), srcRRect.dumpToString(true).c_str(),
|
||||
devRRect.dumpToString(true).c_str());
|
||||
SkASSERTF(!devRRect.isRect(), "Unexpected rect. %d\n\t%s\n\t%s", srcRRect.isRect(),
|
||||
srcRRect.dumpToString(true).c_str(), devRRect.dumpToString(true).c_str());
|
||||
#endif
|
||||
// TODO: loosen this up
|
||||
if (!SkRRectPriv::IsSimpleCircular(devRRect)) {
|
||||
return nullptr;
|
||||
@ -337,18 +342,18 @@ half2 texCoord = translatedFragPos / proxyDims;)SkSL",
|
||||
args.fUniformHandler->getUniformCStr(proxyRectVar),
|
||||
args.fUniformHandler->getUniformCStr(blurRadiusVar),
|
||||
args.fUniformHandler->getUniformCStr(cornerRadiusVar));
|
||||
SkString _sample15531 = this->invokeChild(0, args);
|
||||
SkString _sample15923 = this->invokeChild(0, args);
|
||||
fragBuilder->codeAppendf(
|
||||
R"SkSL(
|
||||
half4 inputColor = %s;)SkSL",
|
||||
_sample15531.c_str());
|
||||
SkString _coords15579("float2(texCoord)");
|
||||
SkString _sample15579 = this->invokeChild(1, args, _coords15579.c_str());
|
||||
_sample15923.c_str());
|
||||
SkString _coords15971("float2(texCoord)");
|
||||
SkString _sample15971 = this->invokeChild(1, args, _coords15971.c_str());
|
||||
fragBuilder->codeAppendf(
|
||||
R"SkSL(
|
||||
%s = inputColor * %s;
|
||||
)SkSL",
|
||||
args.fOutputColor, _sample15579.c_str());
|
||||
args.fOutputColor, _sample15971.c_str());
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user