| 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 "gl/GrGLCaps.h" | 9 #include "gl/GrGLCaps.h" |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 this->onGetGLProcessorKey(caps, b); | 31 this->onGetGLProcessorKey(caps, b); |
| 32 } | 32 } |
| 33 | 33 |
| 34 /////////////////////////////////////////////////////////////////////////////// | 34 /////////////////////////////////////////////////////////////////////////////// |
| 35 | 35 |
| 36 GrXferProcessor* GrXPFactory::createXferProcessor(const GrProcOptInfo& colorPOI, | 36 GrXferProcessor* GrXPFactory::createXferProcessor(const GrProcOptInfo& colorPOI, |
| 37 const GrProcOptInfo& coverageP
OI, | 37 const GrProcOptInfo& coverageP
OI, |
| 38 const GrDeviceCoordTexture* ds
tCopy, | 38 const GrDeviceCoordTexture* ds
tCopy, |
| 39 const GrDrawTargetCaps& caps)
const { | 39 const GrDrawTargetCaps& caps)
const { |
| 40 #ifdef SK_DEBUG | 40 #ifdef SK_DEBUG |
| 41 if (this->willReadDstColor(caps, colorPOI, coveragePOI)) { | 41 if (this->willReadDstColor(colorPOI, coveragePOI)) { |
| 42 if (!caps.dstReadInShaderSupport()) { | 42 if (!caps.dstReadInShaderSupport()) { |
| 43 SkASSERT(dstCopy && dstCopy->texture()); | 43 SkASSERT(dstCopy && dstCopy->texture()); |
| 44 } else { | 44 } else { |
| 45 SkASSERT(!dstCopy || !dstCopy->texture()); | 45 SkASSERT(!dstCopy || !dstCopy->texture()); |
| 46 } | 46 } |
| 47 } else { | 47 } else { |
| 48 SkASSERT(!dstCopy || !dstCopy->texture()); | 48 SkASSERT(!dstCopy || !dstCopy->texture()); |
| 49 |
| 49 } | 50 } |
| 50 #endif | 51 #endif |
| 51 return this->onCreateXferProcessor(caps, colorPOI, coveragePOI, dstCopy); | 52 return this->onCreateXferProcessor(colorPOI, coveragePOI, dstCopy); |
| 52 } | 53 } |
| 53 | 54 |
| 54 bool GrXPFactory::willNeedDstCopy(const GrDrawTargetCaps& caps, const GrProcOptI
nfo& colorPOI, | 55 bool GrXPFactory::willNeedDstCopy(const GrDrawTargetCaps& caps, const GrProcOptI
nfo& colorPOI, |
| 55 const GrProcOptInfo& coveragePOI) const { | 56 const GrProcOptInfo& coveragePOI) const { |
| 56 return (this->willReadDstColor(caps, colorPOI, coveragePOI) && !caps.dstRead
InShaderSupport()); | 57 return (this->willReadDstColor(colorPOI, coveragePOI) && !caps.dstReadInShad
erSupport()); |
| 57 } | 58 } |
| 58 | 59 |
| OLD | NEW |