Fix has_aligned_samples helper for SkGpuDevice::drawTextureProducer
Review URL: https://codereview.chromium.org/1454183002 .
This commit is contained in:
parent
bc890c8490
commit
a911f8f8bb
@ -59,8 +59,8 @@ static const SkScalar kColorBleedTolerance = 0.001f;
|
|||||||
|
|
||||||
static bool has_aligned_samples(const SkRect& srcRect, const SkRect& transformedRect) {
|
static bool has_aligned_samples(const SkRect& srcRect, const SkRect& transformedRect) {
|
||||||
// detect pixel disalignment
|
// detect pixel disalignment
|
||||||
if (SkScalarAbs(SkScalarFraction(transformedRect.left())) < kColorBleedTolerance &&
|
if (SkScalarAbs(SkScalarRoundToScalar(transformedRect.left()) - transformedRect.left()) < kColorBleedTolerance &&
|
||||||
SkScalarAbs(SkScalarFraction(transformedRect.top())) < kColorBleedTolerance &&
|
SkScalarAbs(SkScalarRoundToScalar(transformedRect.top()) - transformedRect.top()) < kColorBleedTolerance &&
|
||||||
SkScalarAbs(transformedRect.width() - srcRect.width()) < kColorBleedTolerance &&
|
SkScalarAbs(transformedRect.width() - srcRect.width()) < kColorBleedTolerance &&
|
||||||
SkScalarAbs(transformedRect.height() - srcRect.height()) < kColorBleedTolerance) {
|
SkScalarAbs(transformedRect.height() - srcRect.height()) < kColorBleedTolerance) {
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user