Use factories instead of directly creating SkImageInfo.

R=reed@google.com

Review URL: https://codereview.chromium.org/169363007

git-svn-id: http://skia.googlecode.com/svn/trunk@13480 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bungeman@google.com 2014-02-17 17:02:17 +00:00
parent 87001ed1f6
commit 2c56cb858f
2 changed files with 3 additions and 16 deletions

View File

@ -52,10 +52,7 @@ public:
* pixels in SkPMColor format.
*/
static SkSurface* NewRasterPMColor(int width, int height) {
SkImageInfo info = {
width, height, kPMColor_SkColorType, kPremul_SkAlphaType
};
return NewRaster(info);
return NewRaster(SkImageInfo::MakeN32Premul(width, height));
}
/**

View File

@ -692,12 +692,7 @@ static PixelPtr getSurfacePixelPtr(SkSurface* surface, bool useGpu) {
}
static void TestDeferredCanvasSurface(skiatest::Reporter* reporter, GrContextFactory* factory) {
SkImageInfo imageSpec = {
10, // width
10, // height
kPMColor_SkColorType,
kPremul_SkAlphaType
};
SkImageInfo imageSpec = SkImageInfo::MakeN32Premul(10, 10);
SkSurface* surface;
bool useGpu = NULL != factory;
#if SK_SUPPORT_GPU
@ -763,12 +758,7 @@ static void TestDeferredCanvasSurface(skiatest::Reporter* reporter, GrContextFac
}
static void TestDeferredCanvasSetSurface(skiatest::Reporter* reporter, GrContextFactory* factory) {
SkImageInfo imageSpec = {
10, // width
10, // height
kPMColor_SkColorType,
kPremul_SkAlphaType
};
SkImageInfo imageSpec = SkImageInfo::MakeN32Premul(10, 10);
SkSurface* surface;
SkSurface* alternateSurface;
bool useGpu = NULL != factory;