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

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

Issue 1966763002: Eliminate special case nvpr batch handling (Closed) Base URL: https://skia.googlesource.com/skia.git@reallyupload_userstencil
Patch Set: fixes Created 4 years, 7 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/GrRenderTargetPriv.h ('k') | src/gpu/batches/GrDrawPathBatch.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 2011 Google Inc. 2 * Copyright 2011 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 8
9 #include "GrStencilSettings.h" 9 #include "GrStencilSettings.h"
10 10
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 GR_STATIC_ASSERT(9 == (int)GrUserStencilOp::kSetClipBit); 163 GR_STATIC_ASSERT(9 == (int)GrUserStencilOp::kSetClipBit);
164 GR_STATIC_ASSERT(10 == (int)GrUserStencilOp::kInvertClipBit); 164 GR_STATIC_ASSERT(10 == (int)GrUserStencilOp::kInvertClipBit);
165 GR_STATIC_ASSERT(11 == (int)GrUserStencilOp::kSetClipAndReplaceUserBits); 165 GR_STATIC_ASSERT(11 == (int)GrUserStencilOp::kSetClipAndReplaceUserBits);
166 GR_STATIC_ASSERT(12 == (int)GrUserStencilOp::kZeroClipAndUserBits); 166 GR_STATIC_ASSERT(12 == (int)GrUserStencilOp::kZeroClipAndUserBits);
167 167
168 void GrStencilSettings::Face::reset(const GrUserStencilSettings::Face& user, boo l hasStencilClip, 168 void GrStencilSettings::Face::reset(const GrUserStencilSettings::Face& user, boo l hasStencilClip,
169 int numStencilBits) { 169 int numStencilBits) {
170 SkASSERT(user.fTest < (GrUserStencilTest)kGrUserStencilTestCount); 170 SkASSERT(user.fTest < (GrUserStencilTest)kGrUserStencilTestCount);
171 SkASSERT(user.fPassOp < (GrUserStencilOp)kGrUserStencilOpCount); 171 SkASSERT(user.fPassOp < (GrUserStencilOp)kGrUserStencilOpCount);
172 SkASSERT(user.fFailOp < (GrUserStencilOp)kGrUserStencilOpCount); 172 SkASSERT(user.fFailOp < (GrUserStencilOp)kGrUserStencilOpCount);
173 SkASSERT(numStencilBits <= 16); 173 SkASSERT(numStencilBits > 0 && numStencilBits <= 16);
174 int clipBit = 1 << (numStencilBits - 1); 174 int clipBit = 1 << (numStencilBits - 1);
175 int userMask = clipBit - 1; 175 int userMask = clipBit - 1;
176 176
177 GrUserStencilOp maxOp = SkTMax(user.fPassOp, user.fFailOp); 177 GrUserStencilOp maxOp = SkTMax(user.fPassOp, user.fFailOp);
178 SkDEBUGCODE(GrUserStencilOp otherOp = SkTMin(user.fPassOp, user.fFailOp);) 178 SkDEBUGCODE(GrUserStencilOp otherOp = SkTMin(user.fPassOp, user.fFailOp);)
179 if (maxOp <= kLastUserOnlyStencilOp) { 179 if (maxOp <= kLastUserOnlyStencilOp) {
180 // Ops that only modify user bits. 180 // Ops that only modify user bits.
181 fWriteMask = user.fWriteMask & userMask; 181 fWriteMask = user.fWriteMask & userMask;
182 SkASSERT(otherOp <= kLastUserOnlyStencilOp); 182 SkASSERT(otherOp <= kLastUserOnlyStencilOp);
183 } else if (maxOp <= kLastClipOnlyStencilOp) { 183 } else if (maxOp <= kLastClipOnlyStencilOp) {
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 GR_STATIC_ASSERT(4 == offsetof(Face, fTestMask)); 480 GR_STATIC_ASSERT(4 == offsetof(Face, fTestMask));
481 GR_STATIC_ASSERT(2 == sizeof(Face::fTestMask)); 481 GR_STATIC_ASSERT(2 == sizeof(Face::fTestMask));
482 GR_STATIC_ASSERT(6 == offsetof(Face, fPassOp)); 482 GR_STATIC_ASSERT(6 == offsetof(Face, fPassOp));
483 GR_STATIC_ASSERT(1 == sizeof(Face::fPassOp)); 483 GR_STATIC_ASSERT(1 == sizeof(Face::fPassOp));
484 GR_STATIC_ASSERT(7 == offsetof(Face, fFailOp)); 484 GR_STATIC_ASSERT(7 == offsetof(Face, fFailOp));
485 GR_STATIC_ASSERT(1 == sizeof(Face::fFailOp)); 485 GR_STATIC_ASSERT(1 == sizeof(Face::fFailOp));
486 GR_STATIC_ASSERT(8 == offsetof(Face, fWriteMask)); 486 GR_STATIC_ASSERT(8 == offsetof(Face, fWriteMask));
487 GR_STATIC_ASSERT(2 == sizeof(Face::fWriteMask)); 487 GR_STATIC_ASSERT(2 == sizeof(Face::fWriteMask));
488 GR_STATIC_ASSERT(10 == sizeof(Face)); 488 GR_STATIC_ASSERT(10 == sizeof(Face));
489 } 489 }
OLDNEW
« no previous file with comments | « src/gpu/GrRenderTargetPriv.h ('k') | src/gpu/batches/GrDrawPathBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698