| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 The Android Open Source Project | 2 * Copyright 2013 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkXfermodeImageFilter.h" | 8 #include "SkXfermodeImageFilter.h" |
| 9 | 9 |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 243 |
| 244 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); | 244 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); |
| 245 | 245 |
| 246 sk_sp<GrDrawContext> drawContext( | 246 sk_sp<GrDrawContext> drawContext( |
| 247 context->makeDrawContext(SkBackingFit::kApprox, bounds.width(), bounds.h
eight(), | 247 context->makeDrawContext(SkBackingFit::kApprox, bounds.width(), bounds.h
eight(), |
| 248 GrRenderableConfigForColorSpace(outputPropertie
s.colorSpace()), | 248 GrRenderableConfigForColorSpace(outputPropertie
s.colorSpace()), |
| 249 sk_ref_sp(outputProperties.colorSpace()))); | 249 sk_ref_sp(outputProperties.colorSpace()))); |
| 250 if (!drawContext) { | 250 if (!drawContext) { |
| 251 return nullptr; | 251 return nullptr; |
| 252 } | 252 } |
| 253 paint.setAllowSRGBInputs(drawContext->isGammaCorrect()); | 253 paint.setGammaCorrect(drawContext->isGammaCorrect()); |
| 254 | 254 |
| 255 SkMatrix matrix; | 255 SkMatrix matrix; |
| 256 matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top
())); | 256 matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top
())); |
| 257 drawContext->drawRect(GrNoClip(), paint, matrix, SkRect::Make(bounds)); | 257 drawContext->drawRect(GrNoClip(), paint, matrix, SkRect::Make(bounds)); |
| 258 | 258 |
| 259 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.he
ight()), | 259 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.he
ight()), |
| 260 kNeedNewImageUniqueID_SpecialImage, | 260 kNeedNewImageUniqueID_SpecialImage, |
| 261 drawContext->asTexture(), | 261 drawContext->asTexture(), |
| 262 sk_ref_sp(drawContext->getColorSpace())); | 262 sk_ref_sp(drawContext->getColorSpace())); |
| 263 } | 263 } |
| 264 | 264 |
| 265 #endif | 265 #endif |
| OLD | NEW |