OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkRRect.h" | 9 #include "SkRRect.h" |
10 #include "SkSurface.h" | 10 #include "SkSurface.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 kRaster_SurfaceType, | 21 kRaster_SurfaceType, |
22 kGpu_SurfaceType, | 22 kGpu_SurfaceType, |
23 kPicture_SurfaceType | 23 kPicture_SurfaceType |
24 }; | 24 }; |
25 | 25 |
26 static SkSurface* createSurface(SurfaceType surfaceType, GrContext* context) { | 26 static SkSurface* createSurface(SurfaceType surfaceType, GrContext* context) { |
27 static const SkImage::Info imageSpec = { | 27 static const SkImage::Info imageSpec = { |
28 10, // width | 28 10, // width |
29 10, // height | 29 10, // height |
30 SkImage::kPMColor_ColorType, | 30 SkImage::kPMColor_ColorType, |
31 SkImage::kPremul_AlphaType | 31 kPremul_SkAlphaType |
32 }; | 32 }; |
33 | 33 |
34 switch (surfaceType) { | 34 switch (surfaceType) { |
35 case kRaster_SurfaceType: | 35 case kRaster_SurfaceType: |
36 return SkSurface::NewRaster(imageSpec); | 36 return SkSurface::NewRaster(imageSpec); |
37 case kGpu_SurfaceType: | 37 case kGpu_SurfaceType: |
38 #if SK_SUPPORT_GPU | 38 #if SK_SUPPORT_GPU |
39 SkASSERT(NULL != context); | 39 SkASSERT(NULL != context); |
40 return SkSurface::NewRenderTarget(context, imageSpec); | 40 return SkSurface::NewRenderTarget(context, imageSpec); |
41 #else | 41 #else |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 TestSurfaceWritableAfterSnapshotRelease(reporter, kGpu_SurfaceType, cont
ext); | 247 TestSurfaceWritableAfterSnapshotRelease(reporter, kGpu_SurfaceType, cont
ext); |
248 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface::kDis
card_ContentChangeMode); | 248 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface::kDis
card_ContentChangeMode); |
249 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface::kRet
ain_ContentChangeMode); | 249 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface::kRet
ain_ContentChangeMode); |
250 TestGetTexture(reporter, kGpu_SurfaceType, context); | 250 TestGetTexture(reporter, kGpu_SurfaceType, context); |
251 } | 251 } |
252 #endif | 252 #endif |
253 } | 253 } |
254 | 254 |
255 #include "TestClassDef.h" | 255 #include "TestClassDef.h" |
256 DEFINE_GPUTESTCLASS("Surface", SurfaceTestClass, TestSurface) | 256 DEFINE_GPUTESTCLASS("Surface", SurfaceTestClass, TestSurface) |
OLD | NEW |