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

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

Issue 820783005: More changes to bring together path / geo procs (Closed) Base URL: https://skia.googlesource.com/skia.git@lc1
Patch Set: dm fix Created 5 years, 11 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/GrOptDrawState.h ('k') | src/gpu/GrOvalRenderer.cpp » ('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 2014 Google Inc. 2 * Copyright 2014 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 "GrOptDrawState.h" 8 #include "GrOptDrawState.h"
9 9
10 #include "GrDrawState.h" 10 #include "GrDrawState.h"
11 #include "GrDrawTargetCaps.h" 11 #include "GrDrawTargetCaps.h"
12 #include "GrGpu.h" 12 #include "GrGpu.h"
13 #include "GrProcOptInfo.h" 13 #include "GrProcOptInfo.h"
14 #include "GrXferProcessor.h" 14 #include "GrXferProcessor.h"
15 15
16 GrOptDrawState::GrOptDrawState(const GrDrawState& drawState, 16 GrOptDrawState::GrOptDrawState(const GrDrawState& drawState,
17 const GrGeometryProcessor* gp, 17 const GrPrimitiveProcessor* primProc,
18 const GrPathProcessor* pathProc,
19 const GrDrawTargetCaps& caps, 18 const GrDrawTargetCaps& caps,
20 const GrScissorState& scissorState, 19 const GrScissorState& scissorState,
21 const GrDeviceCoordTexture* dstCopy, 20 const GrDeviceCoordTexture* dstCopy,
22 GrGpu::DrawType drawType) 21 GrGpu::DrawType drawType)
23 : fFinalized(false) { 22 : fFinalized(false) {
24 fDrawType = drawType; 23 fDrawType = drawType;
25 24
26 // Copy GeometryProcesssor from DS or ODS 25 fPrimitiveProcessor.reset(primProc);
27 if (gp) {
28 SkASSERT(!pathProc);
29 SkASSERT(!GrGpu::IsPathRenderingDrawType(drawType));
30 fGeometryProcessor.reset(gp);
31 fPrimitiveProcessor.reset(gp);
32 } else {
33 SkASSERT(!gp && pathProc && GrGpu::IsPathRenderingDrawType(drawType));
34 fPrimitiveProcessor.reset(pathProc);
35 }
36 26
37 27
38 const GrProcOptInfo& colorPOI = drawState.colorProcInfo(fPrimitiveProcessor) ; 28 const GrProcOptInfo& colorPOI = drawState.colorProcInfo(fPrimitiveProcessor) ;
39 const GrProcOptInfo& coveragePOI = drawState.coverageProcInfo(fPrimitiveProc essor); 29 const GrProcOptInfo& coveragePOI = drawState.coverageProcInfo(fPrimitiveProc essor);
40 30
41 // Create XferProcessor from DS's XPFactory 31 // Create XferProcessor from DS's XPFactory
42 SkAutoTUnref<GrXferProcessor> xferProcessor( 32 SkAutoTUnref<GrXferProcessor> xferProcessor(
43 drawState.getXPFactory()->createXferProcessor(colorPOI, coveragePOI)); 33 drawState.getXPFactory()->createXferProcessor(colorPOI, coveragePOI));
44 34
45 GrColor overrideColor = GrColor_ILLEGAL; 35 GrColor overrideColor = GrColor_ILLEGAL;
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { 188 if (this->getFragmentStage(i) != that.getFragmentStage(i)) {
199 return false; 189 return false;
200 } 190 }
201 } 191 }
202 192
203 // Now update the GrPrimitiveProcessor's batch tracker 193 // Now update the GrPrimitiveProcessor's batch tracker
204 fPrimitiveProcessor->makeEqual(&fBatchTracker, that.getBatchTracker()); 194 fPrimitiveProcessor->makeEqual(&fBatchTracker, that.getBatchTracker());
205 return true; 195 return true;
206 } 196 }
207 197
OLDNEW
« no previous file with comments | « src/gpu/GrOptDrawState.h ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698