Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: tests/WritePixelsTest.cpp

Issue 22978012: Split SkDevice into SkBaseDevice and SkBitmapDevice (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Moved code around to make code review easier Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« include/core/SkDevice.h ('K') | « tests/TileGridTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« include/core/SkDevice.h ('K') | « tests/TileGridTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698