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 "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 Loading... |
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 Loading... |
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 } |
OLD | NEW |