OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 The Android Open Source Project | 2 * Copyright 2010 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 "Resources.h" | 8 #include "Resources.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 return true; | 374 return true; |
375 } | 375 } |
376 SK_TO_STRING_OVERRIDE() | 376 SK_TO_STRING_OVERRIDE() |
377 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(DummyImageFilter) | 377 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(DummyImageFilter) |
378 bool visited() const { return fVisited; } | 378 bool visited() const { return fVisited; } |
379 | 379 |
380 private: | 380 private: |
381 mutable bool fVisited; | 381 mutable bool fVisited; |
382 }; | 382 }; |
383 | 383 |
384 SkFlattenable* DummyImageFilter::CreateProc(SkReadBuffer& buffer) { | 384 sk_sp<SkFlattenable> DummyImageFilter::CreateProc(SkReadBuffer& buffer) { |
385 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0); | 385 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0); |
386 bool visited = buffer.readBool(); | 386 bool visited = buffer.readBool(); |
387 return new DummyImageFilter(visited); | 387 return sk_make_sp<DummyImageFilter>(visited); |
388 } | 388 } |
389 | 389 |
390 #ifndef SK_IGNORE_TO_STRING | 390 #ifndef SK_IGNORE_TO_STRING |
391 void DummyImageFilter::toString(SkString* str) const { | 391 void DummyImageFilter::toString(SkString* str) const { |
392 str->appendf("DummyImageFilter: ("); | 392 str->appendf("DummyImageFilter: ("); |
393 str->append(")"); | 393 str->append(")"); |
394 } | 394 } |
395 #endif | 395 #endif |
396 | 396 |
397 }; | 397 }; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 float alwaysCheck[] = { | 474 float alwaysCheck[] = { |
475 0.0f, -0.0f, 1.0f, -1.0f, SK_ScalarPI, 0.1f, FLT_MIN, FLT_MAX, | 475 0.0f, -0.0f, 1.0f, -1.0f, SK_ScalarPI, 0.1f, FLT_MIN, FLT_MAX, |
476 -FLT_MIN, -FLT_MAX, FLT_MIN / 16.0f, -FLT_MIN / 16.0f, | 476 -FLT_MIN, -FLT_MAX, FLT_MIN / 16.0f, -FLT_MIN / 16.0f, |
477 SK_FloatNaN, SK_FloatInfinity, SK_FloatNegativeInfinity, | 477 SK_FloatNaN, SK_FloatInfinity, SK_FloatNegativeInfinity, |
478 -FLT_MIN / 8388608.0 | 478 -FLT_MIN / 8388608.0 |
479 }; | 479 }; |
480 for (float inputFloat: alwaysCheck) { | 480 for (float inputFloat: alwaysCheck) { |
481 check_pdf_scalar_serialization(reporter, inputFloat); | 481 check_pdf_scalar_serialization(reporter, inputFloat); |
482 } | 482 } |
483 } | 483 } |
OLD | NEW |