| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "TestClassDef.h" |
| 9 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
| 10 #include "SkBitmapDevice.h" | 11 #include "SkBitmapDevice.h" |
| 11 #include "SkCanvas.h" | 12 #include "SkCanvas.h" |
| 12 #include "SkDraw.h" | 13 #include "SkDraw.h" |
| 13 #include "SkLayerDrawLooper.h" | 14 #include "SkLayerDrawLooper.h" |
| 14 #include "SkMatrix.h" | 15 #include "SkMatrix.h" |
| 15 #include "SkPaint.h" | 16 #include "SkPaint.h" |
| 16 #include "SkRect.h" | 17 #include "SkRect.h" |
| 17 #include "SkRefCnt.h" | 18 #include "SkRefCnt.h" |
| 18 #include "SkScalar.h" | 19 #include "SkScalar.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 REPORTER_ASSERT(reporter, looper->next(&canvas, &paint)); | 139 REPORTER_ASSERT(reporter, looper->next(&canvas, &paint)); |
| 139 REPORTER_ASSERT(reporter, SkXfermode::IsMode(paint.getXfermode(), SkXfermode
::kSrc_Mode)); | 140 REPORTER_ASSERT(reporter, SkXfermode::IsMode(paint.getXfermode(), SkXfermode
::kSrc_Mode)); |
| 140 canvas.drawRect(SkRect::MakeWH(50.0f, 50.0f), paint); | 141 canvas.drawRect(SkRect::MakeWH(50.0f, 50.0f), paint); |
| 141 REPORTER_ASSERT(reporter, 10.0f == device.fLastMatrix.getTranslateX()); | 142 REPORTER_ASSERT(reporter, 10.0f == device.fLastMatrix.getTranslateX()); |
| 142 REPORTER_ASSERT(reporter, 20.0f == device.fLastMatrix.getTranslateY()); | 143 REPORTER_ASSERT(reporter, 20.0f == device.fLastMatrix.getTranslateY()); |
| 143 | 144 |
| 144 // Only two layers were added, so that should be the end. | 145 // Only two layers were added, so that should be the end. |
| 145 REPORTER_ASSERT(reporter, !looper->next(&canvas, &paint)); | 146 REPORTER_ASSERT(reporter, !looper->next(&canvas, &paint)); |
| 146 } | 147 } |
| 147 | 148 |
| 148 static void TestLayerDrawLooper(skiatest::Reporter* reporter) { | 149 DEF_TEST(LayerDrawLooper, reporter) { |
| 149 test_frontToBack(reporter); | 150 test_frontToBack(reporter); |
| 150 test_backToFront(reporter); | 151 test_backToFront(reporter); |
| 151 test_mixed(reporter); | 152 test_mixed(reporter); |
| 152 } | 153 } |
| 153 | |
| 154 #include "TestClassDef.h" | |
| 155 DEFINE_TESTCLASS("LayerDrawLooper", TestLayerDrawLooperClass, TestLayerDrawLoope
r) | |
| OLD | NEW |