Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: src/core/SkCanvas.cpp

Issue 2059283002: Fix SkImage::asLegacyBitmap() to respect color space info (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix initialization bug for fConservativeIsScaleTranslate, also it's no longer conservative Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkCanvas.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 09c50c69b0248cf2dc83e95c87f07d662c80252c..304ba55750916ce9a0bf88a635a149d5c7ad980d 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -630,7 +630,7 @@ void SkCanvas::resetForNextPicture(const SkIRect& bounds) {
// know that the device is an SkBitmapDevice (really an SkNoPixelsBitmapDevice).
static_cast<SkBitmapDevice*>(fMCRec->fLayer->fDevice)->setNewSize(bounds.size());
fDeviceClipBounds = qr_clip_bounds(bounds);
- fConservativeIsScaleTranslate = true;
+ fIsScaleTranslate = true;
}
SkBaseDevice* SkCanvas::init(SkBaseDevice* device, InitFlags flags) {
@@ -654,6 +654,7 @@ SkBaseDevice* SkCanvas::init(SkBaseDevice* device, InitFlags flags) {
fMCRec = (MCRec*)fMCStack.push_back();
new (fMCRec) MCRec(fConservativeRasterClip);
+ fIsScaleTranslate = true;
SkASSERT(sizeof(DeviceCM) <= sizeof(fDeviceCMStorage));
fMCRec->fLayer = (DeviceCM*)fDeviceCMStorage;
@@ -670,7 +671,6 @@ SkBaseDevice* SkCanvas::init(SkBaseDevice* device, InitFlags flags) {
fMCRec->fLayer->fDevice = SkRef(device);
fMCRec->fRasterClip.setRect(device->getGlobalBounds());
fDeviceClipBounds = qr_clip_bounds(device->getGlobalBounds());
- fConservativeIsScaleTranslate = true;
}
return device;
@@ -1328,7 +1328,7 @@ void SkCanvas::internalRestore() {
}
if (fMCRec) {
- fConservativeIsScaleTranslate = fMCRec->fMatrix.isScaleTranslate();
+ fIsScaleTranslate = fMCRec->fMatrix.isScaleTranslate();
fDeviceClipBounds = qr_clip_bounds(fMCRec->fRasterClip.getBounds());
}
}
@@ -1486,7 +1486,7 @@ void SkCanvas::concat(const SkMatrix& matrix) {
this->checkForDeferredSave();
fDeviceCMDirty = true;
fMCRec->fMatrix.preConcat(matrix);
- fConservativeIsScaleTranslate = fMCRec->fMatrix.isScaleTranslate();
+ fIsScaleTranslate = fMCRec->fMatrix.isScaleTranslate();
this->didConcat(matrix);
}
@@ -1498,7 +1498,7 @@ void SkCanvas::internalSetMatrix(const SkMatrix& matrix) {
void SkCanvas::setMatrix(const SkMatrix& matrix) {
this->checkForDeferredSave();
this->internalSetMatrix(matrix);
- fConservativeIsScaleTranslate = matrix.isScaleTranslate();
+ fIsScaleTranslate = matrix.isScaleTranslate();
this->didSetMatrix(matrix);
}
@@ -1844,11 +1844,11 @@ bool SkCanvas::quickReject(const SkRect& src) const {
SkASSERT(tmp == fDeviceClipBounds);
}
- // Verify that fConservativeIsScaleTranslate is set properly.
- SkASSERT(!fConservativeIsScaleTranslate || fMCRec->fMatrix.isScaleTranslate());
+ // Verify that fIsScaleTranslate is set properly.
+ SkASSERT(fIsScaleTranslate == fMCRec->fMatrix.isScaleTranslate());
#endif
- if (!fConservativeIsScaleTranslate) {
+ if (!fIsScaleTranslate) {
return quick_reject_slow_path(src, fDeviceClipBounds, fMCRec->fMatrix);
}
« no previous file with comments | « include/core/SkCanvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698