OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 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 "SkImageFilter.h" | 8 #include "SkImageFilter.h" |
9 | 9 |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 return true; | 274 return true; |
275 } | 275 } |
276 | 276 |
277 #if SK_SUPPORT_GPU | 277 #if SK_SUPPORT_GPU |
278 sk_sp<SkSpecialImage> SkImageFilter::DrawWithFP(GrContext* context, | 278 sk_sp<SkSpecialImage> SkImageFilter::DrawWithFP(GrContext* context, |
279 sk_sp<GrFragmentProcessor> fp, | 279 sk_sp<GrFragmentProcessor> fp, |
280 const SkIRect& bounds, | 280 const SkIRect& bounds, |
281 const OutputProperties& outputPr
operties) { | 281 const OutputProperties& outputPr
operties) { |
282 GrPaint paint; | 282 GrPaint paint; |
283 paint.addColorFragmentProcessor(std::move(fp)); | 283 paint.addColorFragmentProcessor(std::move(fp)); |
284 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); | 284 paint.setPorterDuffXPFactory(SkBlendMode::kSrc); |
285 | 285 |
286 sk_sp<SkColorSpace> colorSpace = sk_ref_sp(outputProperties.colorSpace()); | 286 sk_sp<SkColorSpace> colorSpace = sk_ref_sp(outputProperties.colorSpace()); |
287 GrPixelConfig config = GrRenderableConfigForColorSpace(colorSpace.get()); | 287 GrPixelConfig config = GrRenderableConfigForColorSpace(colorSpace.get()); |
288 sk_sp<GrDrawContext> drawContext(context->makeDrawContext(SkBackingFit::kApp
rox, | 288 sk_sp<GrDrawContext> drawContext(context->makeDrawContext(SkBackingFit::kApp
rox, |
289 bounds.width(), bo
unds.height(), | 289 bounds.width(), bo
unds.height(), |
290 config, | 290 config, |
291 std::move(colorSpa
ce))); | 291 std::move(colorSpa
ce))); |
292 if (!drawContext) { | 292 if (!drawContext) { |
293 return nullptr; | 293 return nullptr; |
294 } | 294 } |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 sk_sp<SkSpecialImage> result(input->filterImage(src, this->mapContext(ctx),
offset)); | 462 sk_sp<SkSpecialImage> result(input->filterImage(src, this->mapContext(ctx),
offset)); |
463 | 463 |
464 SkASSERT(!result || src->isTextureBacked() == result->isTextureBacked()); | 464 SkASSERT(!result || src->isTextureBacked() == result->isTextureBacked()); |
465 | 465 |
466 return result; | 466 return result; |
467 } | 467 } |
468 | 468 |
469 void SkImageFilter::PurgeCache() { | 469 void SkImageFilter::PurgeCache() { |
470 SkImageFilterCache::Get()->purge(); | 470 SkImageFilterCache::Get()->purge(); |
471 } | 471 } |
OLD | NEW |