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

Side by Side Diff: src/image/SkImage.cpp

Issue 1218663012: Remove SkImage::NewFromBitmap encoded data helper (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 return NULL; 246 return NULL;
247 } 247 }
248 unrefCopy.reset(tex); 248 unrefCopy.reset(tex);
249 } 249 }
250 const SkImageInfo info = bm.info(); 250 const SkImageInfo info = bm.info();
251 return SkNEW_ARGS(SkImage_Gpu, (info.width(), info.height(), info.alphaT ype(), 251 return SkNEW_ARGS(SkImage_Gpu, (info.width(), info.height(), info.alphaT ype(),
252 tex, 0, SkSurface::kNo_Budgeted)); 252 tex, 0, SkSurface::kNo_Budgeted));
253 } 253 }
254 #endif 254 #endif
255 255
256 // Encoded version?
257 if (SkData* encoded = pr->refEncodedData()) {
258 SkAutoTUnref<SkData> data(encoded);
259 return SkImage::NewFromEncoded(encoded); // todo: add origin/subset/et c?
260 }
261
262 // This will check for immutable (share or copy) 256 // This will check for immutable (share or copy)
263 return SkNewImageFromRasterBitmap(bm, false, NULL); 257 return SkNewImageFromRasterBitmap(bm, false, NULL);
264 } 258 }
265 259
266 //////////////////////////////////////////////////////////////////////////////// ////// 260 //////////////////////////////////////////////////////////////////////////////// //////
267 261
268 #if !SK_SUPPORT_GPU 262 #if !SK_SUPPORT_GPU
269 263
270 SkImage* SkImage::NewFromTexture(GrContext*, const GrBackendTextureDesc&, SkAlph aType, 264 SkImage* SkImage::NewFromTexture(GrContext*, const GrBackendTextureDesc&, SkAlph aType,
271 TextureReleaseProc, ReleaseContext) { 265 TextureReleaseProc, ReleaseContext) {
272 return NULL; 266 return NULL;
273 } 267 }
274 268
275 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&, SkAlphaType) { 269 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&, SkAlphaType) {
276 return NULL; 270 return NULL;
277 } 271 }
278 272
279 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk AlphaType) { 273 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk AlphaType) {
280 return NULL; 274 return NULL;
281 } 275 }
282 276
283 #endif 277 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698