| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 static sk_sp<SkImageFilter> make_blue(sk_sp<SkImageFilter> input, | 363 static sk_sp<SkImageFilter> make_blue(sk_sp<SkImageFilter> input, |
| 364 const SkImageFilter::CropRect* cropRect) { | 364 const SkImageFilter::CropRect* cropRect) { |
| 365 sk_sp<SkColorFilter> filter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, | 365 sk_sp<SkColorFilter> filter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, |
| 366 SkXfermode::kSrcIn
_Mode)); | 366 SkXfermode::kSrcIn
_Mode)); |
| 367 return SkColorFilterImageFilter::Make(std::move(filter), std::move(input), c
ropRect); | 367 return SkColorFilterImageFilter::Make(std::move(filter), std::move(input), c
ropRect); |
| 368 } | 368 } |
| 369 | 369 |
| 370 static sk_sp<SkSpecialSurface> create_empty_special_surface(GrContext* context,
int widthHeight) { | 370 static sk_sp<SkSpecialSurface> create_empty_special_surface(GrContext* context,
int widthHeight) { |
| 371 #if SK_SUPPORT_GPU | 371 #if SK_SUPPORT_GPU |
| 372 if (context) { | 372 if (context) { |
| 373 GrSurfaceDesc desc; | 373 return SkSpecialSurface::MakeRenderTarget(context, |
| 374 desc.fConfig = kSkia8888_GrPixelConfig; | 374 widthHeight, widthHeight, |
| 375 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 375 kSkia8888_GrPixelConfig); |
| 376 desc.fWidth = widthHeight; | |
| 377 desc.fHeight = widthHeight; | |
| 378 return SkSpecialSurface::MakeRenderTarget(context, desc); | |
| 379 } else | 376 } else |
| 380 #endif | 377 #endif |
| 381 { | 378 { |
| 382 const SkImageInfo info = SkImageInfo::MakeN32(widthHeight, widthHeight, | 379 const SkImageInfo info = SkImageInfo::MakeN32(widthHeight, widthHeight, |
| 383 kOpaque_SkAlphaType); | 380 kOpaque_SkAlphaType); |
| 384 return SkSpecialSurface::MakeRaster(info); | 381 return SkSpecialSurface::MakeRaster(info); |
| 385 } | 382 } |
| 386 } | 383 } |
| 387 | 384 |
| 388 static sk_sp<SkSpecialImage> create_empty_special_image(GrContext* context, int
widthHeight) { | 385 static sk_sp<SkSpecialImage> create_empty_special_image(GrContext* context, int
widthHeight) { |
| (...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1734 { SkColorFilterImageFilter::Make(cf, blif), false }, | 1731 { SkColorFilterImageFilter::Make(cf, blif), false }, |
| 1735 { SkMergeImageFilter::Make(cfif, blif), false }, | 1732 { SkMergeImageFilter::Make(cfif, blif), false }, |
| 1736 { SkComposeImageFilter::Make(blif, cfif), false }, | 1733 { SkComposeImageFilter::Make(blif, cfif), false }, |
| 1737 }; | 1734 }; |
| 1738 | 1735 |
| 1739 for (const auto& rec : recs) { | 1736 for (const auto& rec : recs) { |
| 1740 const bool canHandle = rec.fFilter->canHandleComplexCTM(); | 1737 const bool canHandle = rec.fFilter->canHandleComplexCTM(); |
| 1741 REPORTER_ASSERT(reporter, canHandle == rec.fExpectCanHandle); | 1738 REPORTER_ASSERT(reporter, canHandle == rec.fExpectCanHandle); |
| 1742 } | 1739 } |
| 1743 } | 1740 } |
| OLD | NEW |