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

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

Issue 1288403002: add SkImage::NewFromPicture and a GM to test it (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
« no previous file with comments | « include/core/SkImage.h ('k') | 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 bitmap->reset(); 272 bitmap->reset();
273 return false; 273 return false;
274 } 274 }
275 275
276 if (kRO_LegacyBitmapMode == mode) { 276 if (kRO_LegacyBitmapMode == mode) {
277 bitmap->setImmutable(); 277 bitmap->setImmutable();
278 } 278 }
279 return true; 279 return true;
280 } 280 }
281 281
282 SkImage* SkImage::NewFromPicture(const SkPicture* picture, const SkISize& dimens ions,
283 const SkMatrix* matrix, const SkPaint* paint) {
284 if (!picture) {
285 return nullptr;
286 }
287 return NewFromGenerator(SkImageGenerator::NewFromPicture(dimensions, picture , matrix, paint));
288 }
289
282 //////////////////////////////////////////////////////////////////////////////// ////// 290 //////////////////////////////////////////////////////////////////////////////// //////
283 291
284 #if !SK_SUPPORT_GPU 292 #if !SK_SUPPORT_GPU
285 293
286 SkImage* SkImage::NewFromTexture(GrContext*, const GrBackendTextureDesc&, SkAlph aType, 294 SkImage* SkImage::NewFromTexture(GrContext*, const GrBackendTextureDesc&, SkAlph aType,
287 TextureReleaseProc, ReleaseContext) { 295 TextureReleaseProc, ReleaseContext) {
288 return NULL; 296 return NULL;
289 } 297 }
290 298
291 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&, SkAlphaType) { 299 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&, SkAlphaType) {
292 return NULL; 300 return NULL;
293 } 301 }
294 302
295 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk AlphaType) { 303 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk AlphaType) {
296 return NULL; 304 return NULL;
297 } 305 }
298 306
299 #endif 307 #endif
OLDNEW
« no previous file with comments | « include/core/SkImage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698