diff options
author | 2015-05-22 15:22:48 -0700 | |
---|---|---|
committer | 2015-05-22 15:22:48 -0700 | |
commit | d23a395d519835f78630aaea3f2a2c30ecdffe87 (patch) | |
tree | 641636014edef293ac894052c95ee955678f9512 /include/gpu | |
parent | bb106b5f6ee18f7453b63f3a95f421b60a957f39 (diff) |
Revert of Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names. (patchset #6 id:100001 of https://codereview.chromium.org/1132093004/)
Reason for revert:
This is asserting on GTX660 bots with '!dst'. This may just be catching an existing issue.
https://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Debug/builds/622/steps/dm/logs/stdio
https://build.chromium.org/p/client.skia/builders/Test-Win7-MSVC-ShuttleA-GPU-HD2000-x86-Debug-ANGLE/builds/209/steps/dm/logs/stdio
https://build.chromium.org/p/client.skia/builders/Test-Win8-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug/builds/318/steps/dm/logs/stdio
Original issue's description:
> Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names.
>
> Committed: https://skia.googlesource.com/skia/+/bb106b5f6ee18f7453b63f3a95f421b60a957f39
TBR=egdaniel@google.com,bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/1158453004
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/GrTexture.h | 39 | ||||
-rw-r--r-- | include/gpu/GrXferProcessor.h | 72 | ||||
-rw-r--r-- | include/gpu/effects/GrCoverageSetOpXP.h | 2 | ||||
-rw-r--r-- | include/gpu/effects/GrPorterDuffXferProcessor.h | 2 |
4 files changed, 56 insertions, 59 deletions
diff --git a/include/gpu/GrTexture.h b/include/gpu/GrTexture.h index ddba94065b..d565f2f9a7 100644 --- a/include/gpu/GrTexture.h +++ b/include/gpu/GrTexture.h @@ -70,4 +70,43 @@ private: typedef GrSurface INHERITED; }; +/** + * Represents a texture that is intended to be accessed in device coords with an offset. + */ +class GrDeviceCoordTexture { +public: + GrDeviceCoordTexture() { fOffset.set(0, 0); } + + GrDeviceCoordTexture(const GrDeviceCoordTexture& other) { + *this = other; + } + + GrDeviceCoordTexture(GrTexture* texture, const SkIPoint& offset) + : fTexture(SkSafeRef(texture)) + , fOffset(offset) { + } + + GrDeviceCoordTexture& operator=(const GrDeviceCoordTexture& other) { + fTexture.reset(SkSafeRef(other.fTexture.get())); + fOffset = other.fOffset; + return *this; + } + + const SkIPoint& offset() const { return fOffset; } + + void setOffset(const SkIPoint& offset) { fOffset = offset; } + void setOffset(int ox, int oy) { fOffset.set(ox, oy); } + + GrTexture* texture() const { return fTexture.get(); } + + GrTexture* setTexture(GrTexture* texture) { + fTexture.reset(SkSafeRef(texture)); + return texture; + } + +private: + SkAutoTUnref<GrTexture> fTexture; + SkIPoint fOffset; +}; + #endif diff --git a/include/gpu/GrXferProcessor.h b/include/gpu/GrXferProcessor.h index 812a9b32ab..85e5aa04ed 100644 --- a/include/gpu/GrXferProcessor.h +++ b/include/gpu/GrXferProcessor.h @@ -104,47 +104,6 @@ enum GrXferBarrierType { class GrXferProcessor : public GrProcessor { public: /** - * A texture that contains the dst pixel values and an integer coord offset from device space - * to the space of the texture. Depending on GPU capabilities a DstTexture may be used by a - * GrXferProcessor for blending in the fragment shader. - */ - class DstTexture { - public: - DstTexture() { fOffset.set(0, 0); } - - DstTexture(const DstTexture& other) { - *this = other; - } - - DstTexture(GrTexture* texture, const SkIPoint& offset) - : fTexture(SkSafeRef(texture)) - , fOffset(offset) { - } - - DstTexture& operator=(const DstTexture& other) { - fTexture.reset(SkSafeRef(other.fTexture.get())); - fOffset = other.fOffset; - return *this; - } - - const SkIPoint& offset() const { return fOffset; } - - void setOffset(const SkIPoint& offset) { fOffset = offset; } - void setOffset(int ox, int oy) { fOffset.set(ox, oy); } - - GrTexture* texture() const { return fTexture.get(); } - - GrTexture* setTexture(GrTexture* texture) { - fTexture.reset(SkSafeRef(texture)); - return texture; - } - - private: - SkAutoTUnref<GrTexture> fTexture; - SkIPoint fOffset; - }; - - /** * Sets a unique key on the GrProcessorKeyBuilder calls onGetGLProcessorKey(...) to get the * specific subclass's key. */ @@ -240,15 +199,15 @@ public: * shader. If the returned texture is NULL then the XP is either not reading the dst or we have * extentions that support framebuffer fetching and thus don't need a copy of the dst texture. */ - const GrTexture* getDstTexture() const { return fDstTexture.getTexture(); } + const GrTexture* getDstCopyTexture() const { return fDstCopy.getTexture(); } /** - * Returns the offset in device coords to use when accessing the dst texture to get the dst - * pixel color in the shader. This value is only valid if getDstTexture() != NULL. + * Returns the offset into the DstCopyTexture to use when reading it in the shader. This value + * is only valid if getDstCopyTexture() != NULL. */ - const SkIPoint& dstTextureOffset() const { - SkASSERT(this->getDstTexture()); - return fDstTextureOffset; + const SkIPoint& dstCopyTextureOffset() const { + SkASSERT(this->getDstCopyTexture()); + return fDstCopyTextureOffset; } /** @@ -279,10 +238,10 @@ public: if (this->fReadsCoverage != that.fReadsCoverage) { return false; } - if (this->fDstTexture.getTexture() != that.fDstTexture.getTexture()) { + if (this->fDstCopy.getTexture() != that.fDstCopy.getTexture()) { return false; } - if (this->fDstTextureOffset != that.fDstTextureOffset) { + if (this->fDstCopyTextureOffset != that.fDstCopyTextureOffset) { return false; } return this->onIsEqual(that); @@ -290,7 +249,7 @@ public: protected: GrXferProcessor(); - GrXferProcessor(const DstTexture*, bool willReadDstColor); + GrXferProcessor(const GrDeviceCoordTexture* dstCopy, bool willReadDstColor); private: virtual OptFlags onGetOptimizations(const GrProcOptInfo& colorPOI, @@ -327,8 +286,8 @@ private: bool fWillReadDstColor; bool fReadsCoverage; - SkIPoint fDstTextureOffset; - GrTextureAccess fDstTexture; + SkIPoint fDstCopyTextureOffset; + GrTextureAccess fDstCopy; typedef GrFragmentProcessor INHERITED; }; @@ -350,10 +309,9 @@ GR_MAKE_BITFIELD_OPS(GrXferProcessor::OptFlags); */ class GrXPFactory : public SkRefCnt { public: - typedef GrXferProcessor::DstTexture DstTexture; GrXferProcessor* createXferProcessor(const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI, - const DstTexture*, + const GrDeviceCoordTexture* dstCopy, const GrCaps& caps) const; /** @@ -377,8 +335,8 @@ public: virtual void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI, InvariantOutput*) const = 0; - bool willNeedDstTexture(const GrCaps& caps, const GrProcOptInfo& colorPOI, - const GrProcOptInfo& coveragePOI) const; + bool willNeedDstCopy(const GrCaps& caps, const GrProcOptInfo& colorPOI, + const GrProcOptInfo& coveragePOI) const; bool isEqual(const GrXPFactory& that) const { if (this->classID() != that.classID()) { @@ -408,7 +366,7 @@ private: virtual GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI, - const DstTexture*) const = 0; + const GrDeviceCoordTexture* dstCopy) const = 0; /** * Returns true if the XP generated by this factory will explicitly read dst in the fragment * shader. diff --git a/include/gpu/effects/GrCoverageSetOpXP.h b/include/gpu/effects/GrCoverageSetOpXP.h index 2f4530c300..f4224e1cbe 100644 --- a/include/gpu/effects/GrCoverageSetOpXP.h +++ b/include/gpu/effects/GrCoverageSetOpXP.h @@ -37,7 +37,7 @@ private: GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI, - const DstTexture*) const override; + const GrDeviceCoordTexture* dstCopy) const override; bool willReadDstColor(const GrCaps& /*caps*/, const GrProcOptInfo& /*colorPOI*/, diff --git a/include/gpu/effects/GrPorterDuffXferProcessor.h b/include/gpu/effects/GrPorterDuffXferProcessor.h index e4f72203f6..56ddb372b4 100644 --- a/include/gpu/effects/GrPorterDuffXferProcessor.h +++ b/include/gpu/effects/GrPorterDuffXferProcessor.h @@ -29,7 +29,7 @@ private: GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI, - const DstTexture*) const override; + const GrDeviceCoordTexture* dstCopy) const override; bool willReadDstColor(const GrCaps& caps, const GrProcOptInfo& colorPOI, |