aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-12-04 07:52:57 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-04 14:00:14 +0000
commit8458a2807b4a7220c9849f8032dc611438818641 (patch)
tree0df3c0e936ac88c986f413fc1873fd754b4c1de2 /include
parent0c56d47b7e288eacb5dae3560f478b0d8a4896a3 (diff)
Add unit test for SkDeferredDisplayLists
Change-Id: I015094145cb0af6cfe368c570a5d5280c11c8f28 Reviewed-on: https://skia-review.googlesource.com/78660 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/core/SkSurface.h2
-rw-r--r--include/private/SkDeferredDisplayList.h2
-rw-r--r--include/private/SkSurfaceCharacterization.h18
3 files changed, 14 insertions, 8 deletions
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index a1024039dc..f70db73fe5 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -362,7 +362,7 @@ public:
* The draw will be skipped if the characterization stored in the display list
* isn't compatible with this surface.
*/
- void draw(SkDeferredDisplayList* deferredDisplayList);
+ bool draw(SkDeferredDisplayList* deferredDisplayList);
protected:
SkSurface(int width, int height, const SkSurfaceProps* surfaceProps);
diff --git a/include/private/SkDeferredDisplayList.h b/include/private/SkDeferredDisplayList.h
index c6e67f4dcc..b53390d174 100644
--- a/include/private/SkDeferredDisplayList.h
+++ b/include/private/SkDeferredDisplayList.h
@@ -32,7 +32,7 @@ public:
}
// TODO: remove this. It is just scaffolding to get something up & running
- void draw(SkSurface*);
+ bool draw(SkSurface*);
private:
const SkSurfaceCharacterization fCharacterization;
diff --git a/include/private/SkSurfaceCharacterization.h b/include/private/SkSurfaceCharacterization.h
index 8b20cacb36..f450b704d9 100644
--- a/include/private/SkSurfaceCharacterization.h
+++ b/include/private/SkSurfaceCharacterization.h
@@ -11,6 +11,7 @@
#include "GrTypes.h"
#if SK_SUPPORT_GPU
+#include "GrTypesPriv.h"
#include "SkSurfaceProps.h"
class GrContextThreadSafeProxy;
@@ -21,7 +22,7 @@ class SkColorSpace;
rendering decisions. When passed into a SkDeferredDisplayListRecorder it will copy the
data and pass it on to the SkDeferredDisplayList if/when it is created. Note that both of
those objects (the Recorder and the DisplayList) will take a ref on the
- GrContextThreadSafeProxy object.
+ GrContextThreadSafeProxy and SkColorSpace objects.
*/
class SkSurfaceCharacterization {
public:
@@ -30,7 +31,8 @@ public:
, fWidth(0)
, fHeight(0)
, fConfig(kUnknown_GrPixelConfig)
- , fSampleCnt(0)
+ , fFSAAType(GrFSAAType::kNone)
+ , fStencilCnt(0)
, fSurfaceProps(0, kUnknown_SkPixelGeometry) {
}
@@ -45,7 +47,8 @@ public:
int width() const { return fWidth; }
int height() const { return fHeight; }
GrPixelConfig config() const { return fConfig; }
- int sampleCount() const { return fSampleCnt; }
+ GrFSAAType fsaaType() const { return fFSAAType; }
+ int stencilCount() const { return fStencilCnt; }
SkColorSpace* colorSpace() const { return fColorSpace.get(); }
sk_sp<SkColorSpace> refColorSpace() const { return fColorSpace; }
const SkSurfaceProps& surfaceProps()const { return fSurfaceProps; }
@@ -57,7 +60,8 @@ private:
GrSurfaceOrigin origin,
int width, int height,
GrPixelConfig config,
- int sampleCnt,
+ GrFSAAType fsaaType,
+ int stencilCnt,
sk_sp<SkColorSpace> colorSpace,
const SkSurfaceProps& surfaceProps) {
fContextInfo = contextInfo;
@@ -65,7 +69,8 @@ private:
fWidth = width;
fHeight = height;
fConfig = config;
- fSampleCnt = sampleCnt;
+ fFSAAType = fsaaType;
+ fStencilCnt = stencilCnt;
fColorSpace = std::move(colorSpace);
fSurfaceProps = surfaceProps;
}
@@ -75,7 +80,8 @@ private:
int fWidth;
int fHeight;
GrPixelConfig fConfig;
- int fSampleCnt;
+ GrFSAAType fFSAAType;
+ int fStencilCnt;
sk_sp<SkColorSpace> fColorSpace;
SkSurfaceProps fSurfaceProps;
};