From 7ffbcf909d365eb22c5e22b776aeac7b7472fbf3 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Mon, 4 Dec 2017 12:52:46 -0500 Subject: Add unit test for SkDeferredDisplayLists (take 2) Change-Id: I76a4c77d5b9418cb7fe677bd55ba32a2e336924d Reviewed-on: https://skia-review.googlesource.com/79820 Reviewed-by: Brian Salomon Commit-Queue: Robert Phillips --- include/private/SkDeferredDisplayList.h | 2 +- include/private/SkSurfaceCharacterization.h | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'include/private') 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 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 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 fColorSpace; SkSurfaceProps fSurfaceProps; }; -- cgit v1.2.3