diff options
author | robertphillips <robertphillips@google.com> | 2016-03-21 13:44:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-21 13:44:18 -0700 |
commit | b4bd11e66519f545282f914c67b54bf17cecab84 (patch) | |
tree | 4e8c5c77cfcc77192edc4122cd19334464bb6a2a /src/core/SkSpecialImage.h | |
parent | 60316a9ec4b3d76ff3b63952f463f8ddee8841f8 (diff) |
Update SkSpecialImage to be able to create tight SkImages and SkSurfaces
This calved off of: https://codereview.chromium.org/1810693003/ (Switch SkTileImageFilter over to new onFilterImage interface) since the TileImageFilter needs a tight bitmap/texture/image to perform its draw.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1816223002
Review URL: https://codereview.chromium.org/1816223002
Diffstat (limited to 'src/core/SkSpecialImage.h')
-rw-r--r-- | src/core/SkSpecialImage.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/core/SkSpecialImage.h b/src/core/SkSpecialImage.h index 47ad6ccab7..778bf53449 100644 --- a/src/core/SkSpecialImage.h +++ b/src/core/SkSpecialImage.h @@ -25,6 +25,7 @@ struct SkImageInfo; class SkPaint; class SkPixmap; class SkSpecialSurface; +class SkSurface; enum { kNeedNewImageUniqueID_SpecialImage = 0 @@ -84,16 +85,29 @@ public: ReleaseContext); /** - * Create a new surface with a backend that is compatible with this image. + * Create a new special surface with a backend that is compatible with this special image. */ sk_sp<SkSpecialSurface> makeSurface(const SkImageInfo&) const; /** + * Create a new surface with a backend that is compatible with this special image. + * TODO: switch this to makeSurface once we resolved the naming issue + */ + sk_sp<SkSurface> makeTightSurface(const SkImageInfo&) const; + + /** * Extract a subset of this special image and return it as a special image. * It may or may not point to the same backing memory. */ sk_sp<SkSpecialImage> makeSubset(const SkIRect& subset) const; + /** + * Extract a subset of this special image and return it as an SkImage. + * It may or may not point to the same backing memory. + * TODO: switch this to makeSurface once we resolved the naming issue + */ + sk_sp<SkImage> makeTightSubset(const SkIRect& subset) const; + // These three internal methods will go away (see skbug.com/4965) bool internal_getBM(SkBitmap* result); static sk_sp<SkSpecialImage> internal_fromBM(SkImageFilter::Proxy*, const SkBitmap&); |