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

Side by Side Diff: src/image/SkImagePriv.h

Issue 2199813002: make an image from a mutable bitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixx mmy spilling 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
« no previous file with comments | « no previous file | src/image/SkImage_Raster.cpp » ('j') | 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 #ifndef SkImagePriv_DEFINED 8 #ifndef SkImagePriv_DEFINED
9 #define SkImagePriv_DEFINED 9 #define SkImagePriv_DEFINED
10 10
(...skipping 18 matching lines...) Expand all
29 * they exist on the pixelref. 29 * they exist on the pixelref.
30 * 30 *
31 * It is illegal to call this with a texture-backed bitmap. 31 * It is illegal to call this with a texture-backed bitmap.
32 * 32 *
33 * If the bitmap's colortype cannot be converted into a corresponding 33 * If the bitmap's colortype cannot be converted into a corresponding
34 * SkImageInfo, or the bitmap's pixels cannot be accessed, this will return 34 * SkImageInfo, or the bitmap's pixels cannot be accessed, this will return
35 * nullptr. 35 * nullptr.
36 */ 36 */
37 enum ForceCopyMode { 37 enum ForceCopyMode {
38 kNo_ForceCopyMode, 38 kNo_ForceCopyMode,
39 kYes_ForceCopyMode, // must copy the pixels even if the bitmap is immutable 39 kYes_ForceCopyMode, // must copy the pixels even if the bitmap is immuta ble
40 kNever_ForceCopyMode, // don't ever copy, even if the bitmap is mutable
40 }; 41 };
41 extern sk_sp<SkImage> SkMakeImageFromRasterBitmap(const SkBitmap&, 42 extern sk_sp<SkImage> SkMakeImageFromRasterBitmap(const SkBitmap&,
42 ForceCopyMode = kNo_ForceCopyM ode); 43 ForceCopyMode = kNo_ForceCopyM ode);
43 44
44 // Given an image created from SkNewImageFromBitmap, return its pixelref. This 45 // Given an image created from SkNewImageFromBitmap, return its pixelref. This
45 // may be called to see if the surface and the image share the same pixelref, 46 // may be called to see if the surface and the image share the same pixelref,
46 // in which case the surface may need to perform a copy-on-write. 47 // in which case the surface may need to perform a copy-on-write.
47 extern const SkPixelRef* SkBitmapImageGetPixelRef(const SkImage* rasterImage); 48 extern const SkPixelRef* SkBitmapImageGetPixelRef(const SkImage* rasterImage);
48 49
49 // When a texture is shared by a surface and an image its budgeted status is tha t of the 50 // When a texture is shared by a surface and an image its budgeted status is tha t of the
50 // surface. This function is used when the surface makes a new texture for itsel f in order 51 // surface. This function is used when the surface makes a new texture for itsel f in order
51 // for the orphaned image to determine whether the original texture counts again st the 52 // for the orphaned image to determine whether the original texture counts again st the
52 // budget or not. 53 // budget or not.
53 extern void SkTextureImageApplyBudgetedDecision(SkImage* textureImage); 54 extern void SkTextureImageApplyBudgetedDecision(SkImage* textureImage);
54 55
55 // Update the texture wrapped by an image created with NewTexture. This 56 // Update the texture wrapped by an image created with NewTexture. This
56 // is called when a surface and image share the same GrTexture and the 57 // is called when a surface and image share the same GrTexture and the
57 // surface needs to perform a copy-on-write 58 // surface needs to perform a copy-on-write
58 extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture); 59 extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture);
59 60
60 GrTexture* GrDeepCopyTexture(GrTexture* src, SkBudgeted); 61 GrTexture* GrDeepCopyTexture(GrTexture* src, SkBudgeted);
61 62
62 #endif 63 #endif
OLDNEW
« no previous file with comments | « no previous file | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698