| 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" | |
| 9 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 10 #include "SkBitmapDevice.h" | 9 #include "SkBitmapDevice.h" |
| 11 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| 12 #include "SkDraw.h" | 11 #include "SkDraw.h" |
| 13 #include "SkLayerDrawLooper.h" | 12 #include "SkLayerDrawLooper.h" |
| 14 #include "SkMatrix.h" | 13 #include "SkMatrix.h" |
| 15 #include "SkPaint.h" | 14 #include "SkPaint.h" |
| 16 #include "SkRect.h" | 15 #include "SkRect.h" |
| 17 #include "SkRefCnt.h" | 16 #include "SkRefCnt.h" |
| 18 #include "SkScalar.h" | 17 #include "SkScalar.h" |
| 19 #include "SkXfermode.h" | 18 #include "SkXfermode.h" |
| 19 #include "Test.h" |
| 20 | 20 |
| 21 class FakeDevice : public SkBitmapDevice { | 21 class FakeDevice : public SkBitmapDevice { |
| 22 public: | 22 public: |
| 23 FakeDevice() : SkBitmapDevice(SkBitmap::kARGB_8888_Config, 100, 100, false)
{ } | 23 FakeDevice() : SkBitmapDevice(SkBitmap::kARGB_8888_Config, 100, 100, false)
{ } |
| 24 | 24 |
| 25 virtual void drawRect(const SkDraw& draw, const SkRect& r, | 25 virtual void drawRect(const SkDraw& draw, const SkRect& r, |
| 26 const SkPaint& paint) SK_OVERRIDE { | 26 const SkPaint& paint) SK_OVERRIDE { |
| 27 fLastMatrix = *draw.fMatrix; | 27 fLastMatrix = *draw.fMatrix; |
| 28 INHERITED::drawRect(draw, r, paint); | 28 INHERITED::drawRect(draw, r, paint); |
| 29 } | 29 } |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 // Only two layers were added, so that should be the end. | 144 // Only two layers were added, so that should be the end. |
| 145 REPORTER_ASSERT(reporter, !looper->next(&canvas, &paint)); | 145 REPORTER_ASSERT(reporter, !looper->next(&canvas, &paint)); |
| 146 } | 146 } |
| 147 | 147 |
| 148 DEF_TEST(LayerDrawLooper, reporter) { | 148 DEF_TEST(LayerDrawLooper, reporter) { |
| 149 test_frontToBack(reporter); | 149 test_frontToBack(reporter); |
| 150 test_backToFront(reporter); | 150 test_backToFront(reporter); |
| 151 test_mixed(reporter); | 151 test_mixed(reporter); |
| 152 } | 152 } |
| OLD | NEW |