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

Side by Side Diff: tests/RecordOptsTest.cpp

Issue 1825073002: Revert[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: remove flag 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/PictureTest.cpp ('k') | tests/SerializationTest.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 2014 Google Inc. 2 * Copyright 2014 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 "Test.h" 8 #include "Test.h"
9 #include "RecordTestUtils.h" 9 #include "RecordTestUtils.h"
10 10
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 SkRect clip = SkRect::MakeWH(SkIntToScalar(50), SkIntToScalar(60)); 217 SkRect clip = SkRect::MakeWH(SkIntToScalar(50), SkIntToScalar(60));
218 218
219 SkPaint alphaOnlyLayerPaint; 219 SkPaint alphaOnlyLayerPaint;
220 alphaOnlyLayerPaint.setColor(0x03000000); // Only alpha. 220 alphaOnlyLayerPaint.setColor(0x03000000); // Only alpha.
221 SkPaint translucentLayerPaint; 221 SkPaint translucentLayerPaint;
222 translucentLayerPaint.setColor(0x03040506); // Not only alpha. 222 translucentLayerPaint.setColor(0x03040506); // Not only alpha.
223 SkPaint xfermodePaint; 223 SkPaint xfermodePaint;
224 xfermodePaint.setXfermodeMode(SkXfermode::kDstIn_Mode); 224 xfermodePaint.setXfermodeMode(SkXfermode::kDstIn_Mode);
225 SkPaint colorFilterPaint; 225 SkPaint colorFilterPaint;
226 colorFilterPaint.setColorFilter( 226 colorFilterPaint.setColorFilter(
227 SkColorFilter::CreateModeFilter(SK_ColorLTGRAY, SkXfermode::kSrcIn_Mode) )->unref(); 227 SkColorFilter::MakeModeFilter(SK_ColorLTGRAY, SkXfermode::kSrcIn_Mode));
228 228
229 SkPaint opaqueFilterLayerPaint; 229 SkPaint opaqueFilterLayerPaint;
230 opaqueFilterLayerPaint.setColor(0xFF020202); // Opaque. 230 opaqueFilterLayerPaint.setColor(0xFF020202); // Opaque.
231 SkPaint translucentFilterLayerPaint; 231 SkPaint translucentFilterLayerPaint;
232 translucentFilterLayerPaint.setColor(0x0F020202); // Not opaque. 232 translucentFilterLayerPaint.setColor(0x0F020202); // Not opaque.
233 sk_sp<SkPicture> shape; 233 sk_sp<SkPicture> shape;
234 { 234 {
235 SkPictureRecorder recorder; 235 SkPictureRecorder recorder;
236 SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(100), SkIntToSc alar(100)); 236 SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(100), SkIntToSc alar(100));
237 SkPaint shapePaint; 237 SkPaint shapePaint;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 recorder.saveLayer(nullptr, &opaqueFilterLayerPaint); 336 recorder.saveLayer(nullptr, &opaqueFilterLayerPaint);
337 recorder.restore(); 337 recorder.restore();
338 recorder.restore(); 338 recorder.restore();
339 SkRecordMergeSvgOpacityAndFilterLayers(&record); 339 SkRecordMergeSvgOpacityAndFilterLayers(&record);
340 assert_type<SkRecords::SaveLayer>(r, record, index); 340 assert_type<SkRecords::SaveLayer>(r, record, index);
341 assert_type<SkRecords::SaveLayer>(r, record, index + 1); 341 assert_type<SkRecords::SaveLayer>(r, record, index + 1);
342 assert_type<SkRecords::Restore>(r, record, index + 2); 342 assert_type<SkRecords::Restore>(r, record, index + 2);
343 assert_type<SkRecords::Restore>(r, record, index + 3); 343 assert_type<SkRecords::Restore>(r, record, index + 3);
344 index += 4; 344 index += 4;
345 } 345 }
OLDNEW
« no previous file with comments | « tests/PictureTest.cpp ('k') | tests/SerializationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698