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

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

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 4 years, 9 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/GrContextFactory.cpp ('k') | src/gpu/GrTextureParamsAdjuster.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 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
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 SkASSERT(effectiveSampleCnt == specs.fEffectiveSampleCnt); 470 SkASSERT(effectiveSampleCnt == specs.fEffectiveSampleCnt);
471 SkASSERT(!this->caps()->sampleLocationsSupport() || 471 SkASSERT(!this->caps()->sampleLocationsSupport() ||
472 !memcmp(locations.get(), specs.fSampleLocations.get(), 472 !memcmp(locations.get(), specs.fSampleLocations.get(),
473 effectiveSampleCnt * sizeof(SkPoint))); 473 effectiveSampleCnt * sizeof(SkPoint)));
474 SkASSERT(surfDescKey <= effectiveKey); 474 SkASSERT(surfDescKey <= effectiveKey);
475 SkASSERT(!fMultisampleSpecsMap[surfDescKey] || fMultisampleSpecsMap[surf DescKey] == &specs); 475 SkASSERT(!fMultisampleSpecsMap[surfDescKey] || fMultisampleSpecsMap[surf DescKey] == &specs);
476 fMultisampleSpecsMap[surfDescKey] = &specs; 476 fMultisampleSpecsMap[surfDescKey] = &specs;
477 return specs; 477 return specs;
478 } 478 }
479 const MultisampleSpecs& specs = *new (&fMultisampleSpecsAllocator) 479 const MultisampleSpecs& specs = *new (&fMultisampleSpecsAllocator)
480 MultisampleSpecs{effectiveKey, effectiveSampleCnt, locations.detach()}; 480 MultisampleSpecs{effectiveKey, effectiveSampleCnt, locations.release()};
481 if (fMultisampleSpecsMap.count() <= effectiveKey) { 481 if (fMultisampleSpecsMap.count() <= effectiveKey) {
482 int n = 1 + effectiveKey - fMultisampleSpecsMap.count(); 482 int n = 1 + effectiveKey - fMultisampleSpecsMap.count();
483 fMultisampleSpecsMap.push_back_n(n, (const MultisampleSpecs*) nullptr); 483 fMultisampleSpecsMap.push_back_n(n, (const MultisampleSpecs*) nullptr);
484 } 484 }
485 fMultisampleSpecsMap[effectiveKey] = &specs; 485 fMultisampleSpecsMap[effectiveKey] = &specs;
486 if (effectiveSampleCnt != desc.fSampleCnt) { 486 if (effectiveSampleCnt != desc.fSampleCnt) {
487 SkASSERT(surfDescKey < effectiveKey); 487 SkASSERT(surfDescKey < effectiveKey);
488 fMultisampleSpecsMap[surfDescKey] = &specs; 488 fMultisampleSpecsMap[surfDescKey] = &specs;
489 } 489 }
490 return specs; 490 return specs;
491 } 491 }
492 492
493 //////////////////////////////////////////////////////////////////////////////// 493 ////////////////////////////////////////////////////////////////////////////////
494 494
495 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) { 495 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) {
496 this->handleDirtyContext(); 496 this->handleDirtyContext();
497 if (GrXferBarrierType barrierType = args.fPipeline->xferBarrierType(*this->c aps())) { 497 if (GrXferBarrierType barrierType = args.fPipeline->xferBarrierType(*this->c aps())) {
498 this->xferBarrier(args.fPipeline->getRenderTarget(), barrierType); 498 this->xferBarrier(args.fPipeline->getRenderTarget(), barrierType);
499 } 499 }
500 500
501 GrVertices::Iterator iter; 501 GrVertices::Iterator iter;
502 const GrNonInstancedVertices* verts = iter.init(vertices); 502 const GrNonInstancedVertices* verts = iter.init(vertices);
503 do { 503 do {
504 this->onDraw(args, *verts); 504 this->onDraw(args, *verts);
505 fStats.incNumDraws(); 505 fStats.incNumDraws();
506 } while ((verts = iter.next())); 506 } while ((verts = iter.next()));
507 } 507 }
508 508
OLDNEW
« no previous file with comments | « src/gpu/GrContextFactory.cpp ('k') | src/gpu/GrTextureParamsAdjuster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698