OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "Test.h" | 9 #include "Test.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 bmp.setConfig(SkBitmap::kARGB_8888_Config, DEV_W, DEV_H, rowBytes); | 313 bmp.setConfig(SkBitmap::kARGB_8888_Config, DEV_W, DEV_H, rowBytes); |
314 if (!bmp.allocPixels()) { | 314 if (!bmp.allocPixels()) { |
315 sk_throw(); | 315 sk_throw(); |
316 return NULL; | 316 return NULL; |
317 } | 317 } |
318 // if rowBytes isn't tight then set the padding to a known value | 318 // if rowBytes isn't tight then set the padding to a known value |
319 if (rowBytes) { | 319 if (rowBytes) { |
320 SkAutoLockPixels alp(bmp); | 320 SkAutoLockPixels alp(bmp); |
321 memset(bmp.getPixels(), DEV_PAD, bmp.getSafeSize()); | 321 memset(bmp.getPixels(), DEV_PAD, bmp.getSafeSize()); |
322 } | 322 } |
323 return new SkDevice(bmp); | 323 return new SkRasterDevice(bmp); |
324 } | 324 } |
325 #if SK_SUPPORT_GPU | 325 #if SK_SUPPORT_GPU |
326 case kGpu_BottomLeft_DevType: | 326 case kGpu_BottomLeft_DevType: |
327 case kGpu_TopLeft_DevType: | 327 case kGpu_TopLeft_DevType: |
328 GrTextureDesc desc; | 328 GrTextureDesc desc; |
329 desc.fFlags = kRenderTarget_GrTextureFlagBit; | 329 desc.fFlags = kRenderTarget_GrTextureFlagBit; |
330 desc.fWidth = DEV_W; | 330 desc.fWidth = DEV_W; |
331 desc.fHeight = DEV_H; | 331 desc.fHeight = DEV_H; |
332 desc.fConfig = kSkia8888_GrPixelConfig; | 332 desc.fConfig = kSkia8888_GrPixelConfig; |
333 desc.fOrigin = kGpu_TopLeft_DevType == c.fDevType ? | 333 desc.fOrigin = kGpu_TopLeft_DevType == c.fDevType ? |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 } | 468 } |
469 } | 469 } |
470 } | 470 } |
471 } | 471 } |
472 } | 472 } |
473 } | 473 } |
474 } | 474 } |
475 | 475 |
476 #include "TestClassDef.h" | 476 #include "TestClassDef.h" |
477 DEFINE_GPUTESTCLASS("WritePixels", WritePixelsTestClass, WritePixelsTest) | 477 DEFINE_GPUTESTCLASS("WritePixels", WritePixelsTestClass, WritePixelsTest) |
OLD | NEW |