aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private/SkSurfaceCharacterization.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-11-30 11:22:14 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-30 17:10:38 +0000
commit61e51012ee150e12f953bc4225fbdbdc1564007d (patch)
treeb5ba2b7055c5f649df7774527f3cae5704fcadea /include/private/SkSurfaceCharacterization.h
parentf3c1f099de2d0baa174874e3fa51739a160e835c (diff)
Flesh out SkSurfaceCharacterization
This should be it for now except for maybe a GrMipMapped field. Change-Id: I8f20a1048eaa8cd2b5eab5f42ca58c61649f72e7 Reviewed-on: https://skia-review.googlesource.com/78440 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include/private/SkSurfaceCharacterization.h')
-rw-r--r--include/private/SkSurfaceCharacterization.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/include/private/SkSurfaceCharacterization.h b/include/private/SkSurfaceCharacterization.h
index 9f0faf33f4..8b20cacb36 100644
--- a/include/private/SkSurfaceCharacterization.h
+++ b/include/private/SkSurfaceCharacterization.h
@@ -11,8 +11,10 @@
#include "GrTypes.h"
#if SK_SUPPORT_GPU
+#include "SkSurfaceProps.h"
class GrContextThreadSafeProxy;
+class SkColorSpace;
/** \class SkSurfaceCharacterization
A surface characterization contains all the information Ganesh requires to makes its internal
@@ -27,8 +29,9 @@ public:
: fOrigin(kBottomLeft_GrSurfaceOrigin)
, fWidth(0)
, fHeight(0)
- , fConfig(kRGBA_8888_GrPixelConfig)
- , fSampleCnt(0) {
+ , fConfig(kUnknown_GrPixelConfig)
+ , fSampleCnt(0)
+ , fSurfaceProps(0, kUnknown_SkPixelGeometry) {
}
SkSurfaceCharacterization(SkSurfaceCharacterization&&) = default;
@@ -37,35 +40,44 @@ public:
SkSurfaceCharacterization(const SkSurfaceCharacterization&) = default;
SkSurfaceCharacterization& operator=(const SkSurfaceCharacterization& other) = default;
+ GrContextThreadSafeProxy* contextInfo() const { return fContextInfo.get(); }
GrSurfaceOrigin origin() const { return fOrigin; }
int width() const { return fWidth; }
int height() const { return fHeight; }
GrPixelConfig config() const { return fConfig; }
int sampleCount() const { return fSampleCnt; }
- GrContextThreadSafeProxy* contextInfo() const { return fContextInfo.get(); }
+ SkColorSpace* colorSpace() const { return fColorSpace.get(); }
+ sk_sp<SkColorSpace> refColorSpace() const { return fColorSpace; }
+ const SkSurfaceProps& surfaceProps()const { return fSurfaceProps; }
private:
friend class SkSurface_Gpu; // for 'set'
- void set(GrSurfaceOrigin origin,
+ void set(sk_sp<GrContextThreadSafeProxy> contextInfo,
+ GrSurfaceOrigin origin,
int width, int height,
GrPixelConfig config,
int sampleCnt,
- sk_sp<GrContextThreadSafeProxy> contextInfo) {
+ sk_sp<SkColorSpace> colorSpace,
+ const SkSurfaceProps& surfaceProps) {
+ fContextInfo = contextInfo;
fOrigin = origin;
fWidth = width;
fHeight = height;
fConfig = config;
fSampleCnt = sampleCnt;
- fContextInfo = contextInfo;
+ fColorSpace = std::move(colorSpace);
+ fSurfaceProps = surfaceProps;
}
+ sk_sp<GrContextThreadSafeProxy> fContextInfo;
GrSurfaceOrigin fOrigin;
int fWidth;
int fHeight;
GrPixelConfig fConfig;
int fSampleCnt;
- sk_sp<GrContextThreadSafeProxy> fContextInfo;
+ sk_sp<SkColorSpace> fColorSpace;
+ SkSurfaceProps fSurfaceProps;
};
#else// !SK_SUPPORT_GPU