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

Side by Side Diff: tests/SurfaceTest.cpp

Issue 24130009: promote SkImage::AlphaType to SkAlphaType (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « tests/PathTest.cpp ('k') | tools/skhello.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 /* 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
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
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)
OLDNEW
« no previous file with comments | « tests/PathTest.cpp ('k') | tools/skhello.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698