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

Unified Diff: src/image/SkImagePriv.h

Issue 872543002: Take budgeted param when snapping new image. (Closed) Base URL: https://skia.googlesource.com/skia.git@budgeted
Patch Set: Address comment and rebase Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkSurface.h ('k') | src/image/SkImage_Gpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImagePriv.h
diff --git a/src/image/SkImagePriv.h b/src/image/SkImagePriv.h
index 7306934b9ac647ad5fac10d6fbc4af6927847fe2..874476bbaf873dd51771392fbc3b8fae7aa826f9 100644
--- a/src/image/SkImagePriv.h
+++ b/src/image/SkImagePriv.h
@@ -9,6 +9,7 @@
#define SkImagePriv_DEFINED
#include "SkImage.h"
+#include "SkSurface.h"
// Call this if you explicitly want to use/share this pixelRef in the image
extern SkImage* SkNewImageFromPixelRef(const SkImageInfo&, SkPixelRef*, size_t rowBytes,
@@ -40,11 +41,18 @@ extern const SkPixelRef* SkBitmapImageGetPixelRef(const SkImage* rasterImage);
// in which case the surface may need to perform a copy-on-write.
extern GrTexture* SkTextureImageGetTexture(SkImage* textureImage);
+// When a texture is shared by a surface and an image its budgeted status is that of the
+// surface. This function is used when the surface makes a new texture for itself in order
+// for the orphaned image to determine whether the original texture counts against the
+// budget or not.
+extern void SkTextureImageApplyBudgetedDecision(SkImage* textureImage);
+
// Update the texture wrapped by an image created with NewTexture. This
// is called when a surface and image share the same GrTexture and the
// surface needs to perform a copy-on-write
extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture);
-extern SkImage* SkNewImageFromBitmapTexture(const SkBitmap&, int sampleCountForNewSurfaces);
+extern SkImage* SkNewImageFromBitmapTexture(const SkBitmap&, int sampleCountForNewSurfaces,
+ SkSurface::Budgeted);
#endif
« no previous file with comments | « include/core/SkSurface.h ('k') | src/image/SkImage_Gpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698