From 2bd8b8100529c96c81c30f749f672f4caf775b04 Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Fri, 1 Nov 2013 13:46:54 +0000 Subject: move SkImage::ColorType into SkColorType objective -- move clients over to SkImage tasks - use SkImageInfo instead of SkBitmap::Config - add support for colortables to SkImage - add drawImage to SkCanvas - return SkImage from readPixels This CL works towards the first task R=robertphillips@google.com Review URL: https://codereview.chromium.org/54363008 git-svn-id: http://skia.googlecode.com/svn/trunk@12077 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/CachedDecodingPixelRefTest.cpp | 2 +- tests/DeferredCanvasTest.cpp | 10 +++++----- tests/DrawBitmapRectTest.cpp | 4 ++-- tests/SurfaceTest.cpp | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'tests') diff --git a/tests/CachedDecodingPixelRefTest.cpp b/tests/CachedDecodingPixelRefTest.cpp index e3b249923e..08d492cda1 100644 --- a/tests/CachedDecodingPixelRefTest.cpp +++ b/tests/CachedDecodingPixelRefTest.cpp @@ -55,7 +55,7 @@ static SkData* create_data_from_bitmap(const SkBitmap& bm, static bool simple_bitmap_factory(SkBitmapFactory::DecodeProc proc, SkData* data, SkBitmap* dst) { - SkImage::Info info; + SkImageInfo info; if (!proc(data->data(), data->size(), &info, NULL)) { return false; } diff --git a/tests/DeferredCanvasTest.cpp b/tests/DeferredCanvasTest.cpp index 537a810aa9..a9679a339d 100644 --- a/tests/DeferredCanvasTest.cpp +++ b/tests/DeferredCanvasTest.cpp @@ -57,7 +57,7 @@ public: return SkNEW_ARGS(SkCanvas, (fBitmap)); } - virtual SkSurface* onNewSurface(const SkImage::Info&) SK_OVERRIDE { + virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE { return NULL; } @@ -692,10 +692,10 @@ static PixelPtr getSurfacePixelPtr(SkSurface* surface, bool useGpu) { } static void TestDeferredCanvasSurface(skiatest::Reporter* reporter, GrContextFactory* factory) { - SkImage::Info imageSpec = { + SkImageInfo imageSpec = { 10, // width 10, // height - SkImage::kPMColor_ColorType, + kPMColor_SkColorType, kPremul_SkAlphaType }; SkSurface* surface; @@ -759,10 +759,10 @@ static void TestDeferredCanvasSurface(skiatest::Reporter* reporter, GrContextFac } static void TestDeferredCanvasSetSurface(skiatest::Reporter* reporter, GrContextFactory* factory) { - SkImage::Info imageSpec = { + SkImageInfo imageSpec = { 10, // width 10, // height - SkImage::kPMColor_ColorType, + kPMColor_SkColorType, kPremul_SkAlphaType }; SkSurface* surface; diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp index 119ad2f652..ab667fdfae 100644 --- a/tests/DrawBitmapRectTest.cpp +++ b/tests/DrawBitmapRectTest.cpp @@ -19,11 +19,11 @@ #include "SkLruImageCache.h" // A BitmapFactory that always fails when asked to return pixels. -static bool FailureDecoder(const void* data, size_t length, SkImage::Info* info, +static bool FailureDecoder(const void* data, size_t length, SkImageInfo* info, const SkBitmapFactory::Target* target) { if (info) { info->fWidth = info->fHeight = 100; - info->fColorType = SkImage::kRGBA_8888_ColorType; + info->fColorType = kRGBA_8888_SkColorType; info->fAlphaType = kPremul_SkAlphaType; } // this will deliberately return false if they are asking us to decode diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp index 61c1e2d6dd..1d713e780b 100644 --- a/tests/SurfaceTest.cpp +++ b/tests/SurfaceTest.cpp @@ -24,10 +24,10 @@ enum SurfaceType { }; static SkSurface* createSurface(SurfaceType surfaceType, GrContext* context) { - static const SkImage::Info imageSpec = { + static const SkImageInfo imageSpec = { 10, // width 10, // height - SkImage::kPMColor_ColorType, + kPMColor_SkColorType, kPremul_SkAlphaType }; -- cgit v1.2.3