aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkSpecialImage.h
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-09-23 13:04:05 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-23 13:04:05 -0700
commiteed6b0e1d865a1f93143c09961debba0aca592ca (patch)
tree961a464d586a0f11007b8a9a482df912e8c5d305 /src/core/SkSpecialImage.h
parent49da334086c4a2c0bc4cb99e97965600dcb72f73 (diff)
Change SkSpecialImage::makeSurface and makeTightSurface to take output
properties (color space), bounds, and (optional) alphaType. We were being pretty inconsistent before. Raster was honoring all components of the info. GPU was using the supplied color type, but propagating the source's color space. All call sites were saying N32. What we want to do is propagate the original device's color space, and pick a good format from that. Rather than force all the clients to jump through hoops constructing an SkImageInfo that meets our criteria, just have them supply the few bits we care about, and do everything else internally. This also lets us always use RGBA on GPU, but N32 on raster. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2349373004 Committed: https://skia.googlesource.com/skia/+/53c38087949252d27cde668368a3eeb59cc2eb00 Review-Url: https://codereview.chromium.org/2349373004
Diffstat (limited to 'src/core/SkSpecialImage.h')
-rw-r--r--src/core/SkSpecialImage.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/SkSpecialImage.h b/src/core/SkSpecialImage.h
index cd8c3141fb..c1f3791edf 100644
--- a/src/core/SkSpecialImage.h
+++ b/src/core/SkSpecialImage.h
@@ -12,7 +12,8 @@
#include "SkRefCnt.h"
#include "SkSurfaceProps.h"
-#include "SkImageInfo.h" // for SkAlphaType
+#include "SkImageFilter.h" // for OutputProperties
+#include "SkImageInfo.h" // for SkAlphaType
class GrContext;
class GrTexture;
@@ -86,13 +87,17 @@ public:
/**
* Create a new special surface with a backend that is compatible with this special image.
*/
- sk_sp<SkSpecialSurface> makeSurface(const SkImageInfo&) const;
+ sk_sp<SkSpecialSurface> makeSurface(const SkImageFilter::OutputProperties& outProps,
+ const SkISize& size,
+ SkAlphaType at = kPremul_SkAlphaType) 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;
+ sk_sp<SkSurface> makeTightSurface(const SkImageFilter::OutputProperties& outProps,
+ const SkISize& size,
+ SkAlphaType at = kPremul_SkAlphaType) const;
/**
* Extract a subset of this special image and return it as a special image.