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

Unified Diff: include/codec/SkCodec.h

Issue 1766413002: Use a smart pointer for SkColorSpace factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix spacing Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/codec_android.gyp ('k') | src/codec/SkBmpCodec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/codec/SkCodec.h
diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h
index 78295eb1fc5a393216bf6e856071ab0da41cf4f6..7e7503acae83f54ccc00bc13a51b4e9ab4a06dc4 100644
--- a/include/codec/SkCodec.h
+++ b/include/codec/SkCodec.h
@@ -10,13 +10,13 @@
#include "../private/SkTemplates.h"
#include "SkColor.h"
-#include "SkColorSpace.h"
#include "SkEncodedFormat.h"
#include "SkImageInfo.h"
#include "SkSize.h"
#include "SkStream.h"
#include "SkTypes.h"
+class SkColorSpace;
class SkData;
class SkPngChunkReader;
class SkSampler;
@@ -104,7 +104,7 @@ public:
* Does not affect ownership.
* Might be NULL.
*/
- SkColorSpace* getColorSpace() const { return fColorSpace; }
+ SkColorSpace* getColorSpace() const { return fColorSpace.get(); }
/**
* Return a size that approximately supports the desired scale factor.
@@ -514,7 +514,7 @@ protected:
* Takes ownership of SkStream*
* Does not affect ownership of SkColorSpace*
*/
- SkCodec(const SkImageInfo&, SkStream*, SkColorSpace* = nullptr);
+ SkCodec(const SkImageInfo&, SkStream*, sk_sp<SkColorSpace> = nullptr);
virtual SkISize onGetScaledDimensions(float /*desiredScale*/) const {
// By default, scaling is not supported.
@@ -645,7 +645,7 @@ private:
const SkImageInfo fSrcInfo;
SkAutoTDelete<SkStream> fStream;
bool fNeedsRewind;
- SkAutoTUnref<SkColorSpace> fColorSpace;
+ sk_sp<SkColorSpace> fColorSpace;
// These fields are only meaningful during scanline decodes.
SkImageInfo fDstInfo;
« no previous file with comments | « gyp/codec_android.gyp ('k') | src/codec/SkBmpCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698