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

Side by Side Diff: src/ports/SkImageEncoder_CG.cpp

Issue 2250683003: Add test for platform encoders, turn off platform encoders by default (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Test on windows Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkTypes.h" 8 #include "SkTypes.h"
9 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) 9 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
10 10
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 return false; 119 return false;
120 } 120 }
121 SkAutoTCallVProc<CGImage, CGImageRelease> agimage(image); 121 SkAutoTCallVProc<CGImage, CGImageRelease> agimage(image);
122 122
123 CGImageDestinationAddImage(dst, image, nullptr); 123 CGImageDestinationAddImage(dst, image, nullptr);
124 return CGImageDestinationFinalize(dst); 124 return CGImageDestinationFinalize(dst);
125 } 125 }
126 126
127 /////////////////////////////////////////////////////////////////////////////// 127 ///////////////////////////////////////////////////////////////////////////////
128 128
129 #ifdef SK_USE_CG_ENCODER
129 static SkImageEncoder* sk_imageencoder_cg_factory(SkImageEncoder::Type t) { 130 static SkImageEncoder* sk_imageencoder_cg_factory(SkImageEncoder::Type t) {
130 switch (t) { 131 switch (t) {
131 case SkImageEncoder::kICO_Type: 132 case SkImageEncoder::kICO_Type:
132 case SkImageEncoder::kBMP_Type: 133 case SkImageEncoder::kBMP_Type:
133 case SkImageEncoder::kGIF_Type: 134 case SkImageEncoder::kGIF_Type:
134 case SkImageEncoder::kJPEG_Type: 135 case SkImageEncoder::kJPEG_Type:
135 case SkImageEncoder::kPNG_Type: 136 case SkImageEncoder::kPNG_Type:
136 break; 137 break;
137 default: 138 default:
138 return nullptr; 139 return nullptr;
139 } 140 }
140 return new SkImageEncoder_CG(t); 141 return new SkImageEncoder_CG(t);
141 } 142 }
142 143
143 static SkImageEncoder_EncodeReg gEReg(sk_imageencoder_cg_factory); 144 static SkImageEncoder_EncodeReg gEReg(sk_imageencoder_cg_factory);
145 #endif
144 146
145 class SkPNGImageEncoder_CG : public SkImageEncoder_CG { 147 SkImageEncoder* CreateImageEncoder_CG(SkImageEncoder::Type type) {
146 public: 148 return new SkImageEncoder_CG(type);
147 SkPNGImageEncoder_CG() 149 }
148 : SkImageEncoder_CG(kPNG_Type) {
149 }
150 };
151
152 DEFINE_ENCODER_CREATOR(PNGImageEncoder_CG);
153 150
154 #endif//defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) 151 #endif//defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698