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

Unified Diff: tools/SkBitmapRegionDecoderInterface.h

Issue 1415243007: Rename SkBitmapRegionDecoder and Create function (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/SkBitmapRegionDecoder.cpp ('k') | tools/SkBitmapRegionDecoderInterface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/SkBitmapRegionDecoderInterface.h
diff --git a/tools/SkBitmapRegionDecoderInterface.h b/tools/SkBitmapRegionDecoderInterface.h
deleted file mode 100644
index 8e19e95a0a9867557dce940725d6b714e46627e8..0000000000000000000000000000000000000000
--- a/tools/SkBitmapRegionDecoderInterface.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkBitmapRegionDecoder_DEFINED
-#define SkBitmapRegionDecoder_DEFINED
-
-#include "SkBitmap.h"
-#include "SkEncodedFormat.h"
-#include "SkStream.h"
-
-/*
- * This class aims to provide an interface to test multiple implementations of
- * SkBitmapRegionDecoder.
- */
-class SkBitmapRegionDecoderInterface {
-public:
-
- enum Strategy {
- kCanvas_Strategy, // Draw to the canvas, uses SkCodec
- kOriginal_Strategy, // Sampling, uses SkImageDecoder
- kAndroidCodec_Strategy, // Uses SkAndroidCodec for scaling and subsetting
- };
-
- /*
- * @param data Refs the data while this object exists, unrefs on destruction
- * @param strategy Strategy used for scaling and subsetting
- * @return Tries to create an SkBitmapRegionDecoder, returns NULL on failure
- */
- static SkBitmapRegionDecoderInterface* CreateBitmapRegionDecoder(
- SkData* data, Strategy strategy);
-
- /*
- * @param stream Takes ownership of the stream
- * @param strategy Strategy used for scaling and subsetting
- * @return Tries to create an SkBitmapRegionDecoder, returns NULL on failure
- */
- static SkBitmapRegionDecoderInterface* CreateBitmapRegionDecoder(
- SkStreamRewindable* stream, Strategy strategy);
-
- /*
- * Decode a scaled region of the encoded image stream
- *
- * @param bitmap Container for decoded pixels. It is assumed that the pixels
- * are initially unallocated and will be allocated by this function.
- * @param allocator Allocator for the pixels. If this is NULL, the default
- * allocator (HeapAllocator) will be used.
- * @param desiredSubset Subset of the original image to decode.
- * @param sampleSize An integer downscaling factor for the decode.
- * @param colorType Preferred output colorType.
- * New implementations should return NULL if they do not support
- * decoding to this color type.
- * The old kOriginal_Strategy will decode to a default color type
- * if this color type is unsupported.
- * @param requireUnpremul If the image is not opaque, we will use this to determine the
- * alpha type to use.
- *
- */
- virtual bool decodeRegion(SkBitmap* bitmap, SkBitmap::Allocator* allocator,
- const SkIRect& desiredSubset, int sampleSize,
- SkColorType colorType, bool requireUnpremul) = 0;
- /*
- * @param Requested destination color type
- * @return true if we support the requested color type and false otherwise
- */
- virtual bool conversionSupported(SkColorType colorType) = 0;
-
- virtual SkEncodedFormat getEncodedFormat() = 0;
-
- int width() const { return fWidth; }
- int height() const { return fHeight; }
-
- virtual ~SkBitmapRegionDecoderInterface() {}
-
-protected:
-
- SkBitmapRegionDecoderInterface(int width, int height)
- : fWidth(width)
- , fHeight(height)
- {}
-
-private:
- const int fWidth;
- const int fHeight;
-};
-
-#endif
« no previous file with comments | « tools/SkBitmapRegionDecoder.cpp ('k') | tools/SkBitmapRegionDecoderInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698