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 "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkData.h" | 9 #include "SkData.h" |
10 #include "SkDevice.h" | 10 #include "SkDevice.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 stop = false; | 162 stop = false; |
163 for (int y = kH/2; y < kH && !stop; ++y) { | 163 for (int y = kH/2; y < kH && !stop; ++y) { |
164 for (int x = 0; x < kW && !stop; ++x) { | 164 for (int x = 0; x < kW && !stop; ++x) { |
165 REPORTER_ASSERT(reporter, origColorPM == pixels[x + y * kW]); | 165 REPORTER_ASSERT(reporter, origColorPM == pixels[x + y * kW]); |
166 if (origColorPM != pixels[x + y * kW]) { | 166 if (origColorPM != pixels[x + y * kW]) { |
167 stop = true; | 167 stop = true; |
168 } | 168 } |
169 } | 169 } |
170 } | 170 } |
171 } | 171 } |
| 172 gpu->deleteTestingOnlyBackendTexture(texHandle); |
| 173 |
172 } | 174 } |
173 #endif | 175 #endif |
174 | 176 |
175 | 177 |
176 static void test_image(skiatest::Reporter* reporter) { | 178 static void test_image(skiatest::Reporter* reporter) { |
177 SkImageInfo info = SkImageInfo::MakeN32Premul(1, 1); | 179 SkImageInfo info = SkImageInfo::MakeN32Premul(1, 1); |
178 size_t rowBytes = info.minRowBytes(); | 180 size_t rowBytes = info.minRowBytes(); |
179 size_t size = info.getSafeSize(rowBytes); | 181 size_t size = info.getSafeSize(rowBytes); |
180 SkData* data = SkData::NewUninitialized(size); | 182 SkData* data = SkData::NewUninitialized(size); |
181 | 183 |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 test_image_color(reporter, refImg, expected1); | 1024 test_image_color(reporter, refImg, expected1); |
1023 #endif | 1025 #endif |
1024 test_image_color(reporter, cpyImg, expected0); | 1026 test_image_color(reporter, cpyImg, expected0); |
1025 | 1027 |
1026 // Now exercise the release proc | 1028 // Now exercise the release proc |
1027 REPORTER_ASSERT(reporter, !releaseCtx.fIsReleased); | 1029 REPORTER_ASSERT(reporter, !releaseCtx.fIsReleased); |
1028 refImg.reset(nullptr); // force a release of the image | 1030 refImg.reset(nullptr); // force a release of the image |
1029 REPORTER_ASSERT(reporter, releaseCtx.fIsReleased); | 1031 REPORTER_ASSERT(reporter, releaseCtx.fIsReleased); |
1030 } | 1032 } |
1031 #endif | 1033 #endif |
OLD | NEW |