| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright 2015 Google Inc. | 2  * Copyright 2015 Google Inc. | 
| 3  * | 3  * | 
| 4  * Use of this source code is governed by a BSD-style license that can be | 4  * Use of this source code is governed by a BSD-style license that can be | 
| 5  * found in the LICENSE file. | 5  * found in the LICENSE file. | 
| 6  */ | 6  */ | 
| 7 | 7 | 
| 8 #include "GrXferProcessor.h" | 8 #include "GrXferProcessor.h" | 
| 9 #include "GrProcOptInfo.h" | 9 #include "GrProcOptInfo.h" | 
| 10 #include "gl/GrGLCaps.h" | 10 #include "gl/GrGLCaps.h" | 
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 60 void GrXferProcessor::getBlendInfo(BlendInfo* blendInfo) const { | 60 void GrXferProcessor::getBlendInfo(BlendInfo* blendInfo) const { | 
| 61     blendInfo->reset(); | 61     blendInfo->reset(); | 
| 62     if (!this->willReadDstColor()) { | 62     if (!this->willReadDstColor()) { | 
| 63         this->onGetBlendInfo(blendInfo); | 63         this->onGetBlendInfo(blendInfo); | 
| 64     } | 64     } | 
| 65 } | 65 } | 
| 66 | 66 | 
| 67 void GrXferProcessor::getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBu
     ilder* b) const { | 67 void GrXferProcessor::getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBu
     ilder* b) const { | 
| 68     uint32_t key = this->willReadDstColor() ? 0x1 : 0x0; | 68     uint32_t key = this->willReadDstColor() ? 0x1 : 0x0; | 
| 69     if (key) { | 69     if (key) { | 
| 70         if (this->getDstTexture()) { | 70         if (const GrTexture* dstTexture = this->getDstTexture()) { | 
| 71             key |= 0x2; | 71             key |= 0x2; | 
| 72         } | 72             if (kTopLeft_GrSurfaceOrigin == dstTexture->origin()) { | 
| 73         if (kTopLeft_GrSurfaceOrigin == this->getDstTexture()->origin()) { | 73                 key |= 0x4; | 
| 74             key |= 0x4; | 74             } | 
| 75         } | 75         } | 
| 76         if (this->readsCoverage()) { | 76         if (this->readsCoverage()) { | 
| 77             key |= 0x8; | 77             key |= 0x8; | 
| 78         } | 78         } | 
| 79     } | 79     } | 
| 80     b->add32(key); | 80     b->add32(key); | 
| 81     this->onGetGLProcessorKey(caps, b); | 81     this->onGetGLProcessorKey(caps, b); | 
| 82 } | 82 } | 
| 83 | 83 | 
| 84 bool GrXferProcessor::willNeedXferBarrier(const GrRenderTarget* rt, | 84 bool GrXferProcessor::willNeedXferBarrier(const GrRenderTarget* rt, | 
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 206     } | 206     } | 
| 207 #endif | 207 #endif | 
| 208     return this->onCreateXferProcessor(caps, colorPOI, coveragePOI, dstTexture); | 208     return this->onCreateXferProcessor(caps, colorPOI, coveragePOI, dstTexture); | 
| 209 } | 209 } | 
| 210 | 210 | 
| 211 bool GrXPFactory::willNeedDstTexture(const GrCaps& caps, const GrProcOptInfo& co
     lorPOI, | 211 bool GrXPFactory::willNeedDstTexture(const GrCaps& caps, const GrProcOptInfo& co
     lorPOI, | 
| 212                                     const GrProcOptInfo& coveragePOI) const { | 212                                     const GrProcOptInfo& coveragePOI) const { | 
| 213     return (this->willReadDstColor(caps, colorPOI, coveragePOI) | 213     return (this->willReadDstColor(caps, colorPOI, coveragePOI) | 
| 214             && !caps.shaderCaps()->dstReadInShaderSupport()); | 214             && !caps.shaderCaps()->dstReadInShaderSupport()); | 
| 215 } | 215 } | 
| OLD | NEW | 
|---|