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

Unified Diff: src/ports/SkImageGeneratorWIC.h

Issue 1785613010: Add SkImageGeneratorWIC (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
Index: src/ports/SkImageGeneratorWIC.h
diff --git a/src/ports/SkImageGeneratorCG.h b/src/ports/SkImageGeneratorWIC.h
similarity index 51%
copy from src/ports/SkImageGeneratorCG.h
copy to src/ports/SkImageGeneratorWIC.h
index cdfeae02b60f6cf263812a9d0379cef289ec28e5..35f2e989d3db8d76aed5b7ebfb19f125d020639c 100644
--- a/src/ports/SkImageGeneratorCG.h
+++ b/src/ports/SkImageGeneratorWIC.h
@@ -5,21 +5,24 @@
* found in the LICENSE file.
*/
-#include "SkTypes.h"
-#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
-
-#include "SkCGUtils.h"
#include "SkData.h"
#include "SkImageGenerator.h"
#include "SkTemplates.h"
+#include "SkTScopedComPtr.h"
+#include "SkTypes.h"
+
+#include <wincodec.h>
-class SkImageGeneratorCG : public SkImageGenerator {
+/*
+ * Requires that the client has initialized COM on the calling thread.
msarett 2016/03/11 18:18:24 This is different than SkImageDecoder_WIC.
scroggo 2016/03/11 19:10:48 Why? The only other use I see of SkAutoCoInitializ
msarett 2016/03/11 19:20:14 It is also used in SkImageDecoder_WIC. com is ini
scroggo 2016/03/11 19:46:21 Right. Why not do it that way in SkImageGeneratorW
+ */
+class SkImageGeneratorWIC : public SkImageGenerator {
public:
/*
* Refs the data if an image generator can be returned. Otherwise does
* not affect the data.
*/
- static SkImageGenerator* NewFromEncodedCG(SkData* data);
+ static SkImageGenerator* NewFromEncodedWIC(SkData* data);
protected:
SkData* onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM) override;
@@ -29,15 +32,16 @@ protected:
private:
/*
- * Takes ownership of the imageSrc
+ * Takes ownership of the imagingFactory
+ * Takes ownership of the imageSource
* Refs the data
*/
- SkImageGeneratorCG(const SkImageInfo& info, const void* imageSrc, SkData* data);
+ SkImageGeneratorWIC(const SkImageInfo& info, IWICImagingFactory* imagingFactory,
+ IWICBitmapSource* imageSource, SkData* data);
- SkAutoTCallVProc<const void, CFRelease> fImageSrc;
- SkAutoTUnref<SkData> fData;
+ SkTScopedComPtr<IWICImagingFactory> fImagingFactory;
+ SkTScopedComPtr<IWICBitmapSource> fImageSource;
+ SkAutoTUnref<SkData> fData;
typedef SkImageGenerator INHERITED;
};
-
-#endif //defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)

Powered by Google App Engine
This is Rietveld 408576698