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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 #endif | 271 #endif |
272 | 272 |
273 static void test_savelayer_extraction(skiatest::Reporter* reporter) { | 273 static void test_savelayer_extraction(skiatest::Reporter* reporter) { |
274 static const int kWidth = 100; | 274 static const int kWidth = 100; |
275 static const int kHeight = 100; | 275 static const int kHeight = 100; |
276 | 276 |
277 // Create complex paint that the bounding box computation code can't | 277 // Create complex paint that the bounding box computation code can't |
278 // optimize away | 278 // optimize away |
279 SkScalar blueToRedMatrix[20] = { 0 }; | 279 SkScalar blueToRedMatrix[20] = { 0 }; |
280 blueToRedMatrix[2] = blueToRedMatrix[18] = SK_Scalar1; | 280 blueToRedMatrix[2] = blueToRedMatrix[18] = SK_Scalar1; |
281 SkAutoTUnref<SkColorFilter> blueToRed(SkColorMatrixFilter::Create(blueToRedM
atrix)); | 281 auto blueToRed(SkColorFilter::MakeMatrixFilterRowMajor255(blueToRedMatrix)); |
282 SkAutoTUnref<SkImageFilter> filter(SkColorFilterImageFilter::Create(blueToRe
d.get())); | 282 SkAutoTUnref<SkImageFilter> filter(SkColorFilterImageFilter::Create(blueToRe
d.get())); |
283 | 283 |
284 SkPaint complexPaint; | 284 SkPaint complexPaint; |
285 complexPaint.setImageFilter(filter); | 285 complexPaint.setImageFilter(filter); |
286 | 286 |
287 sk_sp<SkPicture> pict, child; | 287 sk_sp<SkPicture> pict, child; |
288 SkRTreeFactory bbhFactory; | 288 SkRTreeFactory bbhFactory; |
289 | 289 |
290 { | 290 { |
291 SkPictureRecorder recorder; | 291 SkPictureRecorder recorder; |
(...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1404 | 1404 |
1405 SkAutoTDelete<SkStream> rstream(wstream.detachAsStream()); | 1405 SkAutoTDelete<SkStream> rstream(wstream.detachAsStream()); |
1406 sk_sp<SkPicture> deserializedPicture(SkPicture::MakeFromStream(rstream)); | 1406 sk_sp<SkPicture> deserializedPicture(SkPicture::MakeFromStream(rstream)); |
1407 | 1407 |
1408 REPORTER_ASSERT(r, deserializedPicture != nullptr); | 1408 REPORTER_ASSERT(r, deserializedPicture != nullptr); |
1409 REPORTER_ASSERT(r, deserializedPicture->cullRect().left() == 1); | 1409 REPORTER_ASSERT(r, deserializedPicture->cullRect().left() == 1); |
1410 REPORTER_ASSERT(r, deserializedPicture->cullRect().top() == 2); | 1410 REPORTER_ASSERT(r, deserializedPicture->cullRect().top() == 2); |
1411 REPORTER_ASSERT(r, deserializedPicture->cullRect().right() == 3); | 1411 REPORTER_ASSERT(r, deserializedPicture->cullRect().right() == 3); |
1412 REPORTER_ASSERT(r, deserializedPicture->cullRect().bottom() == 4); | 1412 REPORTER_ASSERT(r, deserializedPicture->cullRect().bottom() == 4); |
1413 } | 1413 } |
OLD | NEW |