Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: tests/PictureTest.cpp

Issue 1827433002: Reland of [2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.o… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/PaintTest.cpp ('k') | tests/RecordOptsTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « tests/PaintTest.cpp ('k') | tests/RecordOptsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698