aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm/DMSrcSink.cpp
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-03-10 07:49:08 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-10 07:49:08 -0800
commitd93c1208520376ec062c8e9b6b7e6d0eac6c6faf (patch)
tree9ac9c992ebca5ed921e0eb6a2d44e7bcb57f3e02 /dm/DMSrcSink.cpp
parente6d665e24feabf6c633452885910efd17e5f025e (diff)
Added (color=8888|f16|srgb) option to gpu configurations, along with gpuf16 and gpusrgb predefined configs. Runs the gpu backend in gamma-correct mode (with either FP16 linear or sRGB 8888 frambuffers).
Diffstat (limited to 'dm/DMSrcSink.cpp')
-rw-r--r--dm/DMSrcSink.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 84af854dea..9d0b545f94 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -930,11 +930,15 @@ GPUSink::GPUSink(GrContextFactory::GLContextType ct,
GrContextFactory::GLContextOptions options,
int samples,
bool diText,
+ SkColorType colorType,
+ SkColorProfileType profileType,
bool threaded)
: fContextType(ct)
, fContextOptions(options)
, fSampleCount(samples)
, fUseDIText(diText)
+ , fColorType(colorType)
+ , fProfileType(profileType)
, fThreaded(threaded) {}
void PreAbandonGpuContextErrorHandler(SkError, void*) {}
@@ -959,7 +963,8 @@ Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log) co
GrContextFactory factory(grOptions);
const SkISize size = src.size();
const SkImageInfo info =
- SkImageInfo::Make(size.width(), size.height(), kN32_SkColorType, kPremul_SkAlphaType);
+ SkImageInfo::Make(size.width(), size.height(), fColorType,
+ kPremul_SkAlphaType, fProfileType);
#if SK_SUPPORT_GPU
const int maxDimension = factory.getContextInfo(fContextType, fContextOptions).
fGrContext->caps()->maxTextureSize();