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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkCachingPixelRef.h" | 9 #include "SkCachingPixelRef.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 continue; | 135 continue; |
136 } | 136 } |
137 } | 137 } |
138 bool comparePixels = (SkImageEncoder::kPNG_Type == type); | 138 bool comparePixels = (SkImageEncoder::kPNG_Type == type); |
139 compare_bitmaps(reporter, original, lazy, comparePixels); | 139 compare_bitmaps(reporter, original, lazy, comparePixels); |
140 } | 140 } |
141 } | 141 } |
142 | 142 |
143 //////////////////////////////////////////////////////////////////////////////// | 143 //////////////////////////////////////////////////////////////////////////////// |
144 static bool install_skCachingPixelRef(SkData* encoded, SkBitmap* dst) { | 144 static bool install_skCachingPixelRef(SkData* encoded, SkBitmap* dst) { |
145 return SkCachingPixelRef::Install(SkImageGenerator::NewFromData(encoded), ds
t); | 145 return SkCachingPixelRef::Install(SkImageGenerator::NewFromEncoded(encoded),
dst); |
146 } | 146 } |
147 static bool install_skDiscardablePixelRef(SkData* encoded, SkBitmap* dst) { | 147 static bool install_skDiscardablePixelRef(SkData* encoded, SkBitmap* dst) { |
148 // Use system-default discardable memory. | 148 // Use system-default discardable memory. |
149 return SkInstallDiscardablePixelRef(encoded, dst); | 149 return SkInstallDiscardablePixelRef(encoded, dst); |
150 } | 150 } |
151 | 151 |
152 //////////////////////////////////////////////////////////////////////////////// | 152 //////////////////////////////////////////////////////////////////////////////// |
153 /** | 153 /** |
154 * This checks to see that a SkCachingPixelRef and a | 154 * This checks to see that a SkCachingPixelRef and a |
155 * SkDiscardablePixelRef works as advertised with a | 155 * SkDiscardablePixelRef works as advertised with a |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 canvas.clear(kDefaultColor); | 352 canvas.clear(kDefaultColor); |
353 canvas.drawImage(image, 0, 0, NULL); | 353 canvas.drawImage(image, 0, 0, NULL); |
354 if (TestImageGenerator::kSucceedGetPixels_TestType == test) { | 354 if (TestImageGenerator::kSucceedGetPixels_TestType == test) { |
355 REPORTER_ASSERT( | 355 REPORTER_ASSERT( |
356 r, TestImageGenerator::Color() == *bitmap.getAddr32(0, 0)); | 356 r, TestImageGenerator::Color() == *bitmap.getAddr32(0, 0)); |
357 } else { | 357 } else { |
358 REPORTER_ASSERT(r, kDefaultColor == bitmap.getColor(0,0)); | 358 REPORTER_ASSERT(r, kDefaultColor == bitmap.getColor(0,0)); |
359 } | 359 } |
360 } | 360 } |
361 } | 361 } |
OLD | NEW |