OLD | NEW |
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 /* Description: | 8 /* Description: |
9 * This test defines a series of elementatry test steps that perform | 9 * This test defines a series of elementatry test steps that perform |
10 * a single or a small group of canvas API calls. Each test step is | 10 * a single or a small group of canvas API calls. Each test step is |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 | 95 |
96 private: | 96 private: |
97 SkCanvas* fTarget; | 97 SkCanvas* fTarget; |
98 }; | 98 }; |
99 | 99 |
100 static void test_clipVisitor(skiatest::Reporter* reporter, SkCanvas* canvas) { | 100 static void test_clipVisitor(skiatest::Reporter* reporter, SkCanvas* canvas) { |
101 SkISize size = canvas->getDeviceSize(); | 101 SkISize size = canvas->getDeviceSize(); |
102 | 102 |
103 SkBitmap bm; | 103 SkBitmap bm; |
104 bm.setConfig(SkImageInfo::MakeN32Premul(size.width(), size.height())); | 104 bm.setInfo(SkImageInfo::MakeN32Premul(size.width(), size.height())); |
105 SkCanvas c(bm); | 105 SkCanvas c(bm); |
106 | 106 |
107 Canvas2CanvasClipVisitor visitor(&c); | 107 Canvas2CanvasClipVisitor visitor(&c); |
108 canvas->replayClips(&visitor); | 108 canvas->replayClips(&visitor); |
109 | 109 |
110 REPORTER_ASSERT(reporter, equal_clips(c, *canvas)); | 110 REPORTER_ASSERT(reporter, equal_clips(c, *canvas)); |
111 } | 111 } |
112 | 112 |
113 static const int kWidth = 2; | 113 static const int kWidth = 2; |
114 static const int kHeight = 2; | 114 static const int kHeight = 2; |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 if (testStepArray()[testStep]->enablePdfTesting()) { | 952 if (testStepArray()[testStep]->enablePdfTesting()) { |
953 TestPdfDevice(reporter, testStepArray()[testStep]); | 953 TestPdfDevice(reporter, testStepArray()[testStep]); |
954 } | 954 } |
955 } | 955 } |
956 | 956 |
957 // Explicitly call reset(), so we don't leak the pixels (since kTestBitmap i
s a global) | 957 // Explicitly call reset(), so we don't leak the pixels (since kTestBitmap i
s a global) |
958 kTestBitmap.reset(); | 958 kTestBitmap.reset(); |
959 | 959 |
960 test_newraster(reporter); | 960 test_newraster(reporter); |
961 } | 961 } |
OLD | NEW |