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

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

Issue 2468653002: Remove GrStencilSettings from GrPipeline (Closed)
Patch Set: Remove GrStencilSettings from GrPipeline Created 4 years, 1 month 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/GrGpu.h ('k') | src/gpu/GrPipeline.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 2010 Google Inc. 2 * Copyright 2010 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 "GrGpu.h" 9 #include "GrGpu.h"
10 10
11 #include "GrBuffer.h" 11 #include "GrBuffer.h"
12 #include "GrCaps.h" 12 #include "GrCaps.h"
13 #include "GrContext.h" 13 #include "GrContext.h"
14 #include "GrGpuResourcePriv.h" 14 #include "GrGpuResourcePriv.h"
15 #include "GrMesh.h" 15 #include "GrMesh.h"
16 #include "GrPathRendering.h" 16 #include "GrPathRendering.h"
17 #include "GrPipeline.h" 17 #include "GrPipeline.h"
18 #include "GrResourceCache.h" 18 #include "GrResourceCache.h"
19 #include "GrResourceProvider.h" 19 #include "GrResourceProvider.h"
20 #include "GrRenderTargetPriv.h" 20 #include "GrRenderTargetPriv.h"
21 #include "GrStencilAttachment.h" 21 #include "GrStencilAttachment.h"
22 #include "GrStencilSettings.h"
22 #include "GrSurfacePriv.h" 23 #include "GrSurfacePriv.h"
23 #include "GrTexturePriv.h" 24 #include "GrTexturePriv.h"
24 #include "SkMathPriv.h" 25 #include "SkMathPriv.h"
25 26
26 GrMesh& GrMesh::operator =(const GrMesh& di) { 27 GrMesh& GrMesh::operator =(const GrMesh& di) {
27 fPrimitiveType = di.fPrimitiveType; 28 fPrimitiveType = di.fPrimitiveType;
28 fStartVertex = di.fStartVertex; 29 fStartVertex = di.fStartVertex;
29 fStartIndex = di.fStartIndex; 30 fStartIndex = di.fStartIndex;
30 fVertexCount = di.fVertexCount; 31 fVertexCount = di.fVertexCount;
31 fIndexCount = di.fIndexCount; 32 fIndexCount = di.fIndexCount;
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 if (GrRenderTarget* target = surface->asRenderTarget()) { 436 if (GrRenderTarget* target = surface->asRenderTarget()) {
436 target->flagAsNeedingResolve(bounds); 437 target->flagAsNeedingResolve(bounds);
437 } 438 }
438 GrTexture* texture = surface->asTexture(); 439 GrTexture* texture = surface->asTexture();
439 if (texture && 1 == mipLevels) { 440 if (texture && 1 == mipLevels) {
440 texture->texturePriv().dirtyMipMaps(true); 441 texture->texturePriv().dirtyMipMaps(true);
441 } 442 }
442 } 443 }
443 } 444 }
444 445
445 const GrGpu::MultisampleSpecs& GrGpu::queryMultisampleSpecs(GrRenderTarget* rt, 446 const GrGpu::MultisampleSpecs& GrGpu::queryMultisampleSpecs(const GrPipeline& pi peline) {
446 const GrStencilSetti ngs& stencil) { 447 GrRenderTarget* rt = pipeline.getRenderTarget();
447 SkASSERT(rt->desc().fSampleCnt > 1); 448 SkASSERT(rt->desc().fSampleCnt > 1);
448 449
450 GrStencilSettings stencil;
451 if (pipeline.isStencilEnabled()) {
452 // TODO: attach stencil and create settings during render target flush.
453 SkASSERT(rt->renderTargetPriv().getStencilAttachment());
454 stencil.reset(*pipeline.getUserStencil(), pipeline.hasStencilClip(),
455 rt->renderTargetPriv().numStencilBits());
456 }
457
449 int effectiveSampleCnt; 458 int effectiveSampleCnt;
450 SkSTArray<16, SkPoint, true> pattern; 459 SkSTArray<16, SkPoint, true> pattern;
451 this->onQueryMultisampleSpecs(rt, stencil, &effectiveSampleCnt, &pattern); 460 this->onQueryMultisampleSpecs(rt, stencil, &effectiveSampleCnt, &pattern);
452 SkASSERT(effectiveSampleCnt >= rt->desc().fSampleCnt); 461 SkASSERT(effectiveSampleCnt >= rt->desc().fSampleCnt);
453 462
454 uint8_t id; 463 uint8_t id;
455 if (this->caps()->sampleLocationsSupport()) { 464 if (this->caps()->sampleLocationsSupport()) {
456 SkASSERT(pattern.count() == effectiveSampleCnt); 465 SkASSERT(pattern.count() == effectiveSampleCnt);
457 const auto& insertResult = fMultisampleSpecsIdMap.insert( 466 const auto& insertResult = fMultisampleSpecsIdMap.insert(
458 MultisampleSpecsIdMap::value_type(pattern, SkTMin(fMultisampleSpecs. count(), 255))); 467 MultisampleSpecsIdMap::value_type(pattern, SkTMin(fMultisampleSpecs. count(), 255)));
(...skipping 25 matching lines...) Expand all
484 // This doesn't have geometric meaning. We just need to define an orderi ng for std::map. 493 // This doesn't have geometric meaning. We just need to define an orderi ng for std::map.
485 if (a[i].x() != b[i].x()) { 494 if (a[i].x() != b[i].x()) {
486 return a[i].x() < b[i].x(); 495 return a[i].x() < b[i].x();
487 } 496 }
488 if (a[i].y() != b[i].y()) { 497 if (a[i].y() != b[i].y()) {
489 return a[i].y() < b[i].y(); 498 return a[i].y() < b[i].y();
490 } 499 }
491 } 500 }
492 return false; // Equal. 501 return false; // Equal.
493 } 502 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrPipeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698