OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 rowBytes = (info.width() + 16) * sizeof(SkPMColor); | 231 rowBytes = (info.width() + 16) * sizeof(SkPMColor); |
232 break; | 232 break; |
233 default: | 233 default: |
234 SkASSERT(0); | 234 SkASSERT(0); |
235 break; | 235 break; |
236 } | 236 } |
237 | 237 |
238 if (alloc) { | 238 if (alloc) { |
239 bitmap->allocPixels(info); | 239 bitmap->allocPixels(info); |
240 } else { | 240 } else { |
241 bitmap->setInfo(info, rowBytes); | 241 bitmap->setConfig(info, rowBytes); |
242 } | 242 } |
243 } | 243 } |
244 | 244 |
245 DEF_GPUTEST(ReadPixels, reporter, factory) { | 245 DEF_GPUTEST(ReadPixels, reporter, factory) { |
246 const SkIRect testRects[] = { | 246 const SkIRect testRects[] = { |
247 // entire thing | 247 // entire thing |
248 DEV_RECT, | 248 DEV_RECT, |
249 // larger on all sides | 249 // larger on all sides |
250 SkIRect::MakeLTRB(-10, -10, DEV_W + 10, DEV_H + 10), | 250 SkIRect::MakeLTRB(-10, -10, DEV_W + 10, DEV_H + 10), |
251 // fully contained | 251 // fully contained |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 checkRead(reporter, wkbmp, clippedRect.fLeft, | 386 checkRead(reporter, wkbmp, clippedRect.fLeft, |
387 clippedRect.fTop, true, false); | 387 clippedRect.fTop, true, false); |
388 } else { | 388 } else { |
389 REPORTER_ASSERT(reporter, !success); | 389 REPORTER_ASSERT(reporter, !success); |
390 } | 390 } |
391 } | 391 } |
392 } | 392 } |
393 } | 393 } |
394 } | 394 } |
395 } | 395 } |
OLD | NEW |