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

Unified Diff: dm/DMSrcSink.cpp

Issue 2069173002: Lots of progress switching to SkColorSpace rather than SkColorProfileType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix bad assert Created 4 years, 6 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 | « dm/DMSrcSink.h ('k') | example/HelloWorld.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index b252290cd50f1cc88866e1820daa7eb4a505ac5f..97f1e4866444792f5c8ecc437bd521f7d200835a 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -1060,14 +1060,14 @@ GPUSink::GPUSink(GrContextFactory::ContextType ct,
int samples,
bool diText,
SkColorType colorType,
- SkColorProfileType profileType,
+ sk_sp<SkColorSpace> colorSpace,
bool threaded)
: fContextType(ct)
, fContextOptions(options)
, fSampleCount(samples)
, fUseDIText(diText)
, fColorType(colorType)
- , fProfileType(profileType)
+ , fColorSpace(std::move(colorSpace))
, fThreaded(threaded) {}
void PreAbandonGpuContextErrorHandler(SkError, void*) {}
@@ -1093,7 +1093,7 @@ Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log) co
const SkISize size = src.size();
const SkImageInfo info =
SkImageInfo::Make(size.width(), size.height(), fColorType,
- kPremul_SkAlphaType, fProfileType);
+ kPremul_SkAlphaType, fColorSpace);
#if SK_SUPPORT_GPU
GrContext* context = factory.getContextInfo(fContextType, fContextOptions).grContext();
const int maxDimension = context->caps()->maxTextureSize();
@@ -1213,9 +1213,9 @@ Error SVGSink::draw(const Src& src, SkBitmap*, SkWStream* dst, SkString*) const
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-RasterSink::RasterSink(SkColorType colorType, SkColorProfileType profileType)
+RasterSink::RasterSink(SkColorType colorType, sk_sp<SkColorSpace> colorSpace)
: fColorType(colorType)
- , fProfileType(profileType) {}
+ , fColorSpace(std::move(colorSpace)) {}
Error RasterSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString*) const {
const SkISize size = src.size();
@@ -1225,7 +1225,7 @@ Error RasterSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString*) con
SkMallocPixelRef::ZeroedPRFactory factory;
dst->allocPixels(SkImageInfo::Make(size.width(), size.height(),
- fColorType, alphaType, fProfileType),
+ fColorType, alphaType, fColorSpace),
&factory,
nullptr/*colortable*/);
SkCanvas canvas(*dst);
« no previous file with comments | « dm/DMSrcSink.h ('k') | example/HelloWorld.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698