| 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 "SkBitmapSource.h" | 10 #include "SkBitmapSource.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 namespace { | 44 namespace { |
| 45 | 45 |
| 46 class MatrixTestImageFilter : public SkImageFilter { | 46 class MatrixTestImageFilter : public SkImageFilter { |
| 47 public: | 47 public: |
| 48 MatrixTestImageFilter(skiatest::Reporter* reporter, const SkMatrix& expected
Matrix) | 48 MatrixTestImageFilter(skiatest::Reporter* reporter, const SkMatrix& expected
Matrix) |
| 49 : SkImageFilter(0, NULL), fReporter(reporter), fExpectedMatrix(expectedMat
rix) { | 49 : SkImageFilter(0, NULL), fReporter(reporter), fExpectedMatrix(expectedMat
rix) { |
| 50 } | 50 } |
| 51 | 51 |
| 52 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context& ctx, | 52 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context& ctx, |
| 53 SkBitmap* result, SkIPoint* offset) const SK_OVER
RIDE { | 53 SkBitmap* result, SkIPoint* offset) const overrid
e { |
| 54 REPORTER_ASSERT(fReporter, ctx.ctm() == fExpectedMatrix); | 54 REPORTER_ASSERT(fReporter, ctx.ctm() == fExpectedMatrix); |
| 55 return true; | 55 return true; |
| 56 } | 56 } |
| 57 | 57 |
| 58 SK_TO_STRING_OVERRIDE() | 58 SK_TO_STRING_OVERRIDE() |
| 59 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(MatrixTestImageFilter) | 59 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(MatrixTestImageFilter) |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE { | 62 void flatten(SkWriteBuffer& buffer) const override { |
| 63 this->INHERITED::flatten(buffer); | 63 this->INHERITED::flatten(buffer); |
| 64 buffer.writeFunctionPtr(fReporter); | 64 buffer.writeFunctionPtr(fReporter); |
| 65 buffer.writeMatrix(fExpectedMatrix); | 65 buffer.writeMatrix(fExpectedMatrix); |
| 66 } | 66 } |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 skiatest::Reporter* fReporter; | 69 skiatest::Reporter* fReporter; |
| 70 SkMatrix fExpectedMatrix; | 70 SkMatrix fExpectedMatrix; |
| 71 | 71 |
| 72 typedef SkImageFilter INHERITED; | 72 typedef SkImageFilter INHERITED; |
| (...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 DEF_GPUTEST(TestNegativeBlurSigmaGPU, reporter, factory) { | 1172 DEF_GPUTEST(TestNegativeBlurSigmaGPU, reporter, factory) { |
| 1173 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); | 1173 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); |
| 1174 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, | 1174 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, |
| 1175 SkSurface::kNo_Budgeted
, | 1175 SkSurface::kNo_Budgeted
, |
| 1176 SkImageInfo::MakeN32Pre
mul(1, 1), | 1176 SkImageInfo::MakeN32Pre
mul(1, 1), |
| 1177 0, | 1177 0, |
| 1178 &gProps)); | 1178 &gProps)); |
| 1179 test_negative_blur_sigma(device, reporter); | 1179 test_negative_blur_sigma(device, reporter); |
| 1180 } | 1180 } |
| 1181 #endif | 1181 #endif |
| OLD | NEW |