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

Side by Side Diff: tests/SurfaceTest.cpp

Issue 551463004: introduce Props to surface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add new file Created 6 years, 3 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
« no previous file with comments | « tests/ResourceCacheTest.cpp ('k') | tools/PictureRenderer.cpp » ('j') | 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 * 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 "SkDecodingImageGenerator.h" 10 #include "SkDecodingImageGenerator.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 case kRaster_SurfaceType: 45 case kRaster_SurfaceType:
46 return SkSurface::NewRaster(info); 46 return SkSurface::NewRaster(info);
47 case kRasterDirect_SurfaceType: { 47 case kRasterDirect_SurfaceType: {
48 const size_t rowBytes = info.minRowBytes(); 48 const size_t rowBytes = info.minRowBytes();
49 void* storage = sk_malloc_throw(info.getSafeSize(rowBytes)); 49 void* storage = sk_malloc_throw(info.getSafeSize(rowBytes));
50 return SkSurface::NewRasterDirectReleaseProc(info, storage, rowBytes , 50 return SkSurface::NewRasterDirectReleaseProc(info, storage, rowBytes ,
51 release_storage, storag e); 51 release_storage, storag e);
52 } 52 }
53 case kGpu_SurfaceType: 53 case kGpu_SurfaceType:
54 #if SK_SUPPORT_GPU 54 #if SK_SUPPORT_GPU
55 return context ? SkSurface::NewRenderTarget(context, info) : NULL; 55 return context ? SkSurface::NewRenderTarget(context, info, 0, NULL) : NULL;
56 #endif 56 #endif
57 break; 57 break;
58 case kGpuScratch_SurfaceType: 58 case kGpuScratch_SurfaceType:
59 #if SK_SUPPORT_GPU 59 #if SK_SUPPORT_GPU
60 return context ? SkSurface::NewScratchRenderTarget(context, info) : NULL; 60 return context ? SkSurface::NewScratchRenderTarget(context, info) : NULL;
61 #endif 61 #endif
62 break; 62 break;
63 } 63 }
64 return NULL; 64 return NULL;
65 } 65 }
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 TestSurfaceNoCanvas(reporter, kGpuScratch_SurfaceType, context, SkSurface::kDiscard_ContentChangeMode); 465 TestSurfaceNoCanvas(reporter, kGpuScratch_SurfaceType, context, SkSurface::kDiscard_ContentChangeMode);
466 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurfa ce::kRetain_ContentChangeMode); 466 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurfa ce::kRetain_ContentChangeMode);
467 TestSurfaceNoCanvas(reporter, kGpuScratch_SurfaceType, context, SkSurface::kRetain_ContentChangeMode); 467 TestSurfaceNoCanvas(reporter, kGpuScratch_SurfaceType, context, SkSurface::kRetain_ContentChangeMode);
468 TestGetTexture(reporter, kGpu_SurfaceType, context); 468 TestGetTexture(reporter, kGpu_SurfaceType, context);
469 TestGetTexture(reporter, kGpuScratch_SurfaceType, context); 469 TestGetTexture(reporter, kGpuScratch_SurfaceType, context);
470 } 470 }
471 } 471 }
472 } 472 }
473 #endif 473 #endif
474 } 474 }
OLDNEW
« no previous file with comments | « tests/ResourceCacheTest.cpp ('k') | tools/PictureRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698