| 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkData.h" | 10 #include "SkData.h" |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 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 SkNEW_ARGS(DummyImageFilter, (visited)); | 387 return new 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 10 matching lines...) Expand all Loading... |
| 408 // Filter just created; should be unvisited. | 408 // Filter just created; should be unvisited. |
| 409 REPORTER_ASSERT(reporter, !filter->visited()); | 409 REPORTER_ASSERT(reporter, !filter->visited()); |
| 410 SkPaint paint; | 410 SkPaint paint; |
| 411 paint.setImageFilter(filter.get()); | 411 paint.setImageFilter(filter.get()); |
| 412 canvas->drawRect(SkRect::MakeWH(100, 100), paint); | 412 canvas->drawRect(SkRect::MakeWH(100, 100), paint); |
| 413 doc->close(); | 413 doc->close(); |
| 414 | 414 |
| 415 // Filter was used in rendering; should be visited. | 415 // Filter was used in rendering; should be visited. |
| 416 REPORTER_ASSERT(reporter, filter->visited()); | 416 REPORTER_ASSERT(reporter, filter->visited()); |
| 417 } | 417 } |
| OLD | NEW |