Chromium Code Reviews| 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 354 sk_sp<SkColorFilter> filter(SkColorFilter::MakeMatrixFilterRowMajor255(matri x)); | 354 sk_sp<SkColorFilter> filter(SkColorFilter::MakeMatrixFilterRowMajor255(matri x)); |
| 355 return SkColorFilterImageFilter::Make(std::move(filter), std::move(input), c ropRect); | 355 return SkColorFilterImageFilter::Make(std::move(filter), std::move(input), c ropRect); |
| 356 } | 356 } |
| 357 | 357 |
| 358 static sk_sp<SkImageFilter> make_blue(sk_sp<SkImageFilter> input, | 358 static sk_sp<SkImageFilter> make_blue(sk_sp<SkImageFilter> input, |
| 359 const SkImageFilter::CropRect* cropRect) { | 359 const SkImageFilter::CropRect* cropRect) { |
| 360 sk_sp<SkColorFilter> filter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, | 360 sk_sp<SkColorFilter> filter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, |
| 361 SkXfermode::kSrcIn _Mode)); | 361 SkXfermode::kSrcIn _Mode)); |
| 362 return SkColorFilterImageFilter::Make(std::move(filter), std::move(input), c ropRect); | 362 return SkColorFilterImageFilter::Make(std::move(filter), std::move(input), c ropRect); |
| 363 } | 363 } |
| 364 | 364 |
|
robertphillips
2016/07/21 19:22:41
It seems like we should be augmenting a lot of the
| |
| 365 static sk_sp<SkSpecialSurface> create_empty_special_surface(GrContext* context, int widthHeight) { | 365 static sk_sp<SkSpecialSurface> create_empty_special_surface(GrContext* context, int widthHeight) { |
| 366 #if SK_SUPPORT_GPU | 366 #if SK_SUPPORT_GPU |
| 367 if (context) { | 367 if (context) { |
| 368 return SkSpecialSurface::MakeRenderTarget(context, | 368 return SkSpecialSurface::MakeRenderTarget(context, |
| 369 widthHeight, widthHeight, | 369 widthHeight, widthHeight, |
| 370 kSkia8888_GrPixelConfig); | 370 kSkia8888_GrPixelConfig, nullp tr); |
| 371 } else | 371 } else |
| 372 #endif | 372 #endif |
| 373 { | 373 { |
| 374 const SkImageInfo info = SkImageInfo::MakeN32(widthHeight, widthHeight, | 374 const SkImageInfo info = SkImageInfo::MakeN32(widthHeight, widthHeight, |
| 375 kOpaque_SkAlphaType); | 375 kOpaque_SkAlphaType); |
| 376 return SkSpecialSurface::MakeRaster(info); | 376 return SkSpecialSurface::MakeRaster(info); |
| 377 } | 377 } |
| 378 } | 378 } |
| 379 | 379 |
| 380 static sk_sp<SkSurface> create_surface(GrContext* context, int width, int height ) { | 380 static sk_sp<SkSurface> create_surface(GrContext* context, int width, int height ) { |
| (...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1854 { SkColorFilterImageFilter::Make(cf, blif), false }, | 1854 { SkColorFilterImageFilter::Make(cf, blif), false }, |
| 1855 { SkMergeImageFilter::Make(cfif, blif), false }, | 1855 { SkMergeImageFilter::Make(cfif, blif), false }, |
| 1856 { SkComposeImageFilter::Make(blif, cfif), false }, | 1856 { SkComposeImageFilter::Make(blif, cfif), false }, |
| 1857 }; | 1857 }; |
| 1858 | 1858 |
| 1859 for (const auto& rec : recs) { | 1859 for (const auto& rec : recs) { |
| 1860 const bool canHandle = rec.fFilter->canHandleComplexCTM(); | 1860 const bool canHandle = rec.fFilter->canHandleComplexCTM(); |
| 1861 REPORTER_ASSERT(reporter, canHandle == rec.fExpectCanHandle); | 1861 REPORTER_ASSERT(reporter, canHandle == rec.fExpectCanHandle); |
| 1862 } | 1862 } |
| 1863 } | 1863 } |
| OLD | NEW |