Plumb dst color space in many places, rather than "mode"
[platform/upstream/libSkiaSharp.git] / src / core / SkDevice.cpp
index 741273b..ff99a09 100644 (file)
@@ -234,11 +234,8 @@ void SkBaseDevice::drawImage(const SkDraw& draw, const SkImage* image, SkScalar
         return;
     }
 
-    SkDestinationSurfaceColorMode colorMode = this->imageInfo().colorSpace()
-        ? SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware
-        : SkDestinationSurfaceColorMode::kLegacy;
     SkBitmap bm;
-    if (as_IB(image)->getROPixels(&bm, colorMode)) {
+    if (as_IB(image)->getROPixels(&bm, this->imageInfo().colorSpace())) {
         this->drawBitmap(draw, bm, SkMatrix::MakeTrans(x, y), paint);
     }
 }
@@ -251,11 +248,8 @@ void SkBaseDevice::drawImageRect(const SkDraw& draw, const SkImage* image, const
         return;
     }
 
-    SkDestinationSurfaceColorMode colorMode = this->imageInfo().colorSpace()
-        ? SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware
-        : SkDestinationSurfaceColorMode::kLegacy;
     SkBitmap bm;
-    if (as_IB(image)->getROPixels(&bm, colorMode)) {
+    if (as_IB(image)->getROPixels(&bm, this->imageInfo().colorSpace())) {
         this->drawBitmapRect(draw, bm, src, dst, paint, constraint);
     }
 }