| 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 "SkBitmapDevice.h" | 9 #include "SkBitmapDevice.h" |
| 10 #include "SkBlurImageFilter.h" | 10 #include "SkBlurImageFilter.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 public: | 53 public: |
| 54 static sk_sp<SkImageFilter> Make(skiatest::Reporter* reporter, | 54 static sk_sp<SkImageFilter> Make(skiatest::Reporter* reporter, |
| 55 const SkMatrix& expectedMatrix) { | 55 const SkMatrix& expectedMatrix) { |
| 56 return sk_sp<SkImageFilter>(new MatrixTestImageFilter(reporter, expected
Matrix)); | 56 return sk_sp<SkImageFilter>(new MatrixTestImageFilter(reporter, expected
Matrix)); |
| 57 } | 57 } |
| 58 | 58 |
| 59 SK_TO_STRING_OVERRIDE() | 59 SK_TO_STRING_OVERRIDE() |
| 60 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(MatrixTestImageFilter) | 60 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(MatrixTestImageFilter) |
| 61 | 61 |
| 62 protected: | 62 protected: |
| 63 bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context& ctx
, | 63 sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context& c
tx, |
| 64 SkBitmap* result, SkIPoint* offset) const overr
ide { | 64 SkIPoint* offset) const override { |
| 65 REPORTER_ASSERT(fReporter, ctx.ctm() == fExpectedMatrix); | 65 REPORTER_ASSERT(fReporter, ctx.ctm() == fExpectedMatrix); |
| 66 return true; | 66 offset->fX = offset->fY = 0; |
| 67 return sk_ref_sp<SkSpecialImage>(source); |
| 67 } | 68 } |
| 68 | 69 |
| 69 void flatten(SkWriteBuffer& buffer) const override { | 70 void flatten(SkWriteBuffer& buffer) const override { |
| 70 this->INHERITED::flatten(buffer); | 71 this->INHERITED::flatten(buffer); |
| 71 buffer.writeFunctionPtr(fReporter); | 72 buffer.writeFunctionPtr(fReporter); |
| 72 buffer.writeMatrix(fExpectedMatrix); | 73 buffer.writeMatrix(fExpectedMatrix); |
| 73 } | 74 } |
| 74 | 75 |
| 75 private: | 76 private: |
| 76 MatrixTestImageFilter(skiatest::Reporter* reporter, const SkMatrix& expected
Matrix) | 77 MatrixTestImageFilter(skiatest::Reporter* reporter, const SkMatrix& expected
Matrix) |
| (...skipping 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1628 | 1629 |
| 1629 test_xfermode_cropped_input(&canvas, reporter); | 1630 test_xfermode_cropped_input(&canvas, reporter); |
| 1630 } | 1631 } |
| 1631 | 1632 |
| 1632 DEF_GPUTEST_FOR_ALL_CONTEXTS(BlurLargeImage_Gpu, reporter, context) { | 1633 DEF_GPUTEST_FOR_ALL_CONTEXTS(BlurLargeImage_Gpu, reporter, context) { |
| 1633 auto surface(SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, | 1634 auto surface(SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, |
| 1634 SkImageInfo::MakeN32Premul(100, 100
))); | 1635 SkImageInfo::MakeN32Premul(100, 100
))); |
| 1635 test_large_blur_input(reporter, surface->getCanvas()); | 1636 test_large_blur_input(reporter, surface->getCanvas()); |
| 1636 } | 1637 } |
| 1637 #endif | 1638 #endif |
| OLD | NEW |