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 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 SkCanvas* c = recorder.beginRecording(SkIntToScalar(kWidth), | 931 SkCanvas* c = recorder.beginRecording(SkIntToScalar(kWidth), |
932 SkIntToScalar(kHeight), | 932 SkIntToScalar(kHeight), |
933 &bbhFactory, | 933 &bbhFactory, |
934 SkPictureRecorder::kComputeSaveLay
erInfo_RecordFlag); | 934 SkPictureRecorder::kComputeSaveLay
erInfo_RecordFlag); |
935 // 1) | 935 // 1) |
936 c->saveLayer(NULL, &complexPaint); // layer #0 | 936 c->saveLayer(NULL, &complexPaint); // layer #0 |
937 c->restore(); | 937 c->restore(); |
938 | 938 |
939 // 2) | 939 // 2) |
940 c->saveLayer(NULL, NULL); // layer #1 | 940 c->saveLayer(NULL, NULL); // layer #1 |
941 c->translate(kWidth/2.0f, kHeight/2.0f); | 941 c->translate(kWidth / 2.0f, kHeight / 2.0f); |
942 SkRect r = SkRect::MakeXYWH(0, 0, kWidth/2, kHeight/2); | 942 SkRect r = SkRect::MakeXYWH(0, 0, kWidth/2, kHeight/2); |
943 c->saveLayer(&r, &complexPaint); // layer #2 | 943 c->saveLayer(&r, &complexPaint); // layer #2 |
944 c->restore(); | 944 c->restore(); |
945 c->restore(); | 945 c->restore(); |
946 | 946 |
947 // 3) | 947 // 3) |
948 { | 948 { |
949 c->saveLayer(NULL, &complexPaint); // layer #3 | 949 c->saveLayer(NULL, &complexPaint); // layer #3 |
950 c->restore(); | 950 c->restore(); |
951 } | 951 } |
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1919 | 1919 |
1920 // The picture shares the immutable pixels but copies the mutable ones. | 1920 // The picture shares the immutable pixels but copies the mutable ones. |
1921 REPORTER_ASSERT(r, mut.pixelRef()->unique()); | 1921 REPORTER_ASSERT(r, mut.pixelRef()->unique()); |
1922 REPORTER_ASSERT(r, !immut.pixelRef()->unique()); | 1922 REPORTER_ASSERT(r, !immut.pixelRef()->unique()); |
1923 | 1923 |
1924 // When the picture goes away, it's just our bitmaps holding the refs. | 1924 // When the picture goes away, it's just our bitmaps holding the refs. |
1925 pic.reset(NULL); | 1925 pic.reset(NULL); |
1926 REPORTER_ASSERT(r, mut.pixelRef()->unique()); | 1926 REPORTER_ASSERT(r, mut.pixelRef()->unique()); |
1927 REPORTER_ASSERT(r, immut.pixelRef()->unique()); | 1927 REPORTER_ASSERT(r, immut.pixelRef()->unique()); |
1928 } | 1928 } |
OLD | NEW |