OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkBBoxHierarchy.h" | 8 #include "SkBBoxHierarchy.h" |
9 #include "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1402 SkCanvas* c = recorder.beginRecording(SkRect::MakeLTRB(1, 2, 3, 4)); | 1402 SkCanvas* c = recorder.beginRecording(SkRect::MakeLTRB(1, 2, 3, 4)); |
1403 c->clear(SK_ColorCYAN); | 1403 c->clear(SK_ColorCYAN); |
1404 | 1404 |
1405 SkAutoTUnref<SkPicture> picture(recorder.endRecording()); | 1405 SkAutoTUnref<SkPicture> picture(recorder.endRecording()); |
1406 SkDynamicMemoryWStream wstream; | 1406 SkDynamicMemoryWStream wstream; |
1407 picture->serialize(&wstream); | 1407 picture->serialize(&wstream); |
1408 | 1408 |
1409 SkAutoTDelete<SkStream> rstream(wstream.detachAsStream()); | 1409 SkAutoTDelete<SkStream> rstream(wstream.detachAsStream()); |
1410 SkAutoTUnref<SkPicture> deserializedPicture(SkPicture::CreateFromStream(rstr
eam)); | 1410 SkAutoTUnref<SkPicture> deserializedPicture(SkPicture::CreateFromStream(rstr
eam)); |
1411 | 1411 |
1412 REPORTER_ASSERT(r, deserializedPicture != nullptr); | 1412 REPORTER_ASSERT(r, SkToBool(deserializedPicture)); |
1413 REPORTER_ASSERT(r, deserializedPicture->cullRect().left() == 1); | 1413 REPORTER_ASSERT(r, deserializedPicture->cullRect().left() == 1); |
1414 REPORTER_ASSERT(r, deserializedPicture->cullRect().top() == 2); | 1414 REPORTER_ASSERT(r, deserializedPicture->cullRect().top() == 2); |
1415 REPORTER_ASSERT(r, deserializedPicture->cullRect().right() == 3); | 1415 REPORTER_ASSERT(r, deserializedPicture->cullRect().right() == 3); |
1416 REPORTER_ASSERT(r, deserializedPicture->cullRect().bottom() == 4); | 1416 REPORTER_ASSERT(r, deserializedPicture->cullRect().bottom() == 4); |
1417 } | 1417 } |
OLD | NEW |