From: bungeman@google.com Date: Mon, 17 Feb 2014 17:02:17 +0000 (+0000) Subject: Use factories instead of directly creating SkImageInfo. X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~8980 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c56cb858f9227599746828d1a06b1b1588b44f0;p=platform%2Fupstream%2FlibSkiaSharp.git 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 --- diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h index 74c5f08..8e430d8 100644 --- a/include/core/SkSurface.h +++ b/include/core/SkSurface.h @@ -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)); } /** diff --git a/tests/DeferredCanvasTest.cpp b/tests/DeferredCanvasTest.cpp index 4b67f19..62b1b17 100644 --- a/tests/DeferredCanvasTest.cpp +++ b/tests/DeferredCanvasTest.cpp @@ -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;