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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 2164363002: Add SkColorSpace to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove ':' from comment Created 4 years, 5 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 | « src/gpu/SkGpuDevice.h ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 2b4c0842a0ae35e010e12ab14a0e03a1d03e4684..20e5afef9fc613bad1a5187f52fd13581072cbb1 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -126,8 +126,8 @@ bool SkGpuDevice::CheckAlphaTypeAndGetFlags(
return true;
}
-sk_sp<SkGpuDevice> SkGpuDevice::Make(sk_sp<GrRenderTarget> rt, const SkSurfaceProps* props,
- InitContents init) {
+sk_sp<SkGpuDevice> SkGpuDevice::Make(sk_sp<GrRenderTarget> rt, sk_sp<SkColorSpace> colorSpace,
+ const SkSurfaceProps* props, InitContents init) {
if (!rt || rt->wasDestroyed() || !rt->getContext()) {
return nullptr;
}
@@ -141,7 +141,8 @@ sk_sp<SkGpuDevice> SkGpuDevice::Make(sk_sp<GrRenderTarget> rt, const SkSurfacePr
GrContext* context = rt->getContext();
- sk_sp<GrDrawContext> drawContext(context->drawContext(std::move(rt), props));
+ sk_sp<GrDrawContext> drawContext(context->drawContext(std::move(rt), std::move(colorSpace),
+ props));
return sk_sp<SkGpuDevice>(new SkGpuDevice(std::move(drawContext), width, height, flags));
}
@@ -223,7 +224,7 @@ sk_sp<GrDrawContext> SkGpuDevice::CreateDrawContext(GrContext* context,
return context->newDrawContext(SkBackingFit::kExact, // Why exact?
origInfo.width(), origInfo.height(),
- config, sampleCount,
+ config, sk_ref_sp(cs), sampleCount,
kDefault_GrSurfaceOrigin, surfaceProps, budgeted);
}
@@ -1842,6 +1843,7 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint
sk_sp<GrDrawContext> dc(fContext->newDrawContext(fit,
cinfo.fInfo.width(), cinfo.fInfo.height(),
fDrawContext->config(),
+ sk_ref_sp(fDrawContext->getColorSpace()),
fDrawContext->desc().fSampleCnt,
kDefault_GrSurfaceOrigin,
&props));
« no previous file with comments | « src/gpu/SkGpuDevice.h ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698