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