Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: src/gpu/GrXferProcessor.cpp

Issue 1109863004: Use GLSLCaps for creating processor keys and GLSL-specific programs (Closed) Base URL: https://chromium.googlesource.com/skia@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrProgramDesc.h ('k') | src/gpu/effects/GrBezierEffect.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 GrXferProcessor::GrXferProcessor() : fWillReadDstColor(false), fDstCopyTextureOf fset() { 11 GrXferProcessor::GrXferProcessor() : fWillReadDstColor(false), fDstCopyTextureOf fset() {
12 } 12 }
13 13
14 GrXferProcessor::GrXferProcessor(const GrDeviceCoordTexture* dstCopy, bool willR eadDstColor) 14 GrXferProcessor::GrXferProcessor(const GrDeviceCoordTexture* dstCopy, bool willR eadDstColor)
15 : fWillReadDstColor(willReadDstColor) 15 : fWillReadDstColor(willReadDstColor)
16 , fDstCopyTextureOffset() { 16 , fDstCopyTextureOffset() {
17 if (dstCopy && dstCopy->texture()) { 17 if (dstCopy && dstCopy->texture()) {
18 fDstCopy.reset(dstCopy->texture()); 18 fDstCopy.reset(dstCopy->texture());
19 fDstCopyTextureOffset = dstCopy->offset(); 19 fDstCopyTextureOffset = dstCopy->offset();
20 this->addTextureAccess(&fDstCopy); 20 this->addTextureAccess(&fDstCopy);
21 this->setWillReadFragmentPosition(); 21 this->setWillReadFragmentPosition();
22 } 22 }
23 } 23 }
24 24
25 void GrXferProcessor::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuil der* b) const { 25 void GrXferProcessor::getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBu ilder* b) const {
26 uint32_t key = this->willReadDstColor() ? 0x1 : 0x0; 26 uint32_t key = this->willReadDstColor() ? 0x1 : 0x0;
27 if (this->getDstCopyTexture() && 27 if (this->getDstCopyTexture() &&
28 kTopLeft_GrSurfaceOrigin == this->getDstCopyTexture()->origin()) { 28 kTopLeft_GrSurfaceOrigin == this->getDstCopyTexture()->origin()) {
29 key |= 0x2; 29 key |= 0x2;
30 } 30 }
31 b->add32(key); 31 b->add32(key);
32 this->onGetGLProcessorKey(caps, b); 32 this->onGetGLProcessorKey(caps, b);
33 } 33 }
34 34
35 /////////////////////////////////////////////////////////////////////////////// 35 ///////////////////////////////////////////////////////////////////////////////
(...skipping 14 matching lines...) Expand all
50 } 50 }
51 #endif 51 #endif
52 return this->onCreateXferProcessor(caps, colorPOI, coveragePOI, dstCopy); 52 return this->onCreateXferProcessor(caps, colorPOI, coveragePOI, dstCopy);
53 } 53 }
54 54
55 bool GrXPFactory::willNeedDstCopy(const GrDrawTargetCaps& caps, const GrProcOptI nfo& colorPOI, 55 bool GrXPFactory::willNeedDstCopy(const GrDrawTargetCaps& caps, const GrProcOptI nfo& colorPOI,
56 const GrProcOptInfo& coveragePOI) const { 56 const GrProcOptInfo& coveragePOI) const {
57 return (this->willReadDstColor(caps, colorPOI, coveragePOI) && !caps.dstRead InShaderSupport()); 57 return (this->willReadDstColor(caps, colorPOI, coveragePOI) && !caps.dstRead InShaderSupport());
58 } 58 }
59 59
OLDNEW
« no previous file with comments | « src/gpu/GrProgramDesc.h ('k') | src/gpu/effects/GrBezierEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698