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

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

Issue 134843008: Revert of Revert "Revert of https://codereview.chromium.org/129423002/" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | src/image/SkImagePriv.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
11 #include "SkBitmap.h" 11 #include "SkBitmap.h"
12 #include "SkImage.h" 12 #include "SkImage.h"
13 13
14 class SkPicture; 14 class SkPicture;
15 15
16 extern SkBitmap::Config SkImageInfoToBitmapConfig(const SkImageInfo&); 16 extern SkBitmap::Config SkImageInfoToBitmapConfig(const SkImageInfo&);
17 extern SkBitmap::Config SkColorTypeToBitmapConfig(SkColorType); 17 extern SkBitmap::Config SkColorTypeToBitmapConfig(SkColorType);
18 extern bool SkBitmapConfigToColorType(SkBitmap::Config, SkColorType* ctOut); 18 extern bool SkBitmapConfigToColorType(SkBitmap::Config, SkColorType* ctOut);
19 19
20 // Call this if you explicitly want to use/share this pixelRef in the image 20 // Call this if you explicitly want to use/share this pixelRef in the image
21 extern SkImage* SkNewImageFromPixelRef(SkPixelRef*); 21 extern SkImage* SkNewImageFromPixelRef(const SkImageInfo&, SkPixelRef*,
22 size_t rowBytes);
22 23
23 /** 24 /**
24 * Examines the bitmap to decide if it can share the existing pixelRef, or 25 * Examines the bitmap to decide if it can share the existing pixelRef, or
25 * if it needs to make a deep-copy of the pixels. The bitmap's pixelref will 26 * if it needs to make a deep-copy of the pixels. The bitmap's pixelref will
26 * be shared if either the bitmap is marked as immutable, or canSharePixelRef 27 * be shared if either the bitmap is marked as immutable, or canSharePixelRef
27 * is true. 28 * is true.
28 * 29 *
29 * If the bitmap's config cannot be converted into a corresponding 30 * If the bitmap's config cannot be converted into a corresponding
30 * SkImageInfo, or the bitmap's pixels cannot be accessed, this will return 31 * SkImageInfo, or the bitmap's pixels cannot be accessed, this will return
31 * NULL. 32 * NULL.
(...skipping 28 matching lines...) Expand all
60 // may be called to see if the surface and the image share the same GrTexture, 61 // may be called to see if the surface and the image share the same GrTexture,
61 // in which case the surface may need to perform a copy-on-write. 62 // in which case the surface may need to perform a copy-on-write.
62 extern GrTexture* SkTextureImageGetTexture(SkImage* textureImage); 63 extern GrTexture* SkTextureImageGetTexture(SkImage* textureImage);
63 64
64 // Update the texture wrapped by an image created with NewTexture. This 65 // Update the texture wrapped by an image created with NewTexture. This
65 // is called when a surface and image share the same GrTexture and the 66 // is called when a surface and image share the same GrTexture and the
66 // surface needs to perform a copy-on-write 67 // surface needs to perform a copy-on-write
67 extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture); 68 extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture);
68 69
69 #endif 70 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | src/image/SkImagePriv.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698