| OLD | NEW | 
|---|
| 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  Loading... | 
| 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  Loading... | 
| 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 } | 
| OLD | NEW | 
|---|