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

Unified Diff: src/gpu/GrPipelineBuilder.cpp

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reserve correctly. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrPipelineBuilder.h ('k') | src/gpu/GrProcessorUnitTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPipelineBuilder.cpp
diff --git a/src/gpu/GrPipelineBuilder.cpp b/src/gpu/GrPipelineBuilder.cpp
index f7848ba9d627d016beb36a79651688560f83dbae..e142de25a337ec22aa679602f1430c8cccc07867 100644
--- a/src/gpu/GrPipelineBuilder.cpp
+++ b/src/gpu/GrPipelineBuilder.cpp
@@ -27,11 +27,11 @@ GrPipelineBuilder::GrPipelineBuilder(const GrPaint& paint, bool useHWAA)
SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
for (int i = 0; i < paint.numColorFragmentProcessors(); ++i) {
- fColorFragmentProcessors.push_back(SkRef(paint.getColorFragmentProcessor(i)));
+ fColorFragmentProcessors.emplace_back(SkRef(paint.getColorFragmentProcessor(i)));
}
for (int i = 0; i < paint.numCoverageFragmentProcessors(); ++i) {
- fCoverageFragmentProcessors.push_back(SkRef(paint.getCoverageFragmentProcessor(i)));
+ fCoverageFragmentProcessors.emplace_back(SkRef(paint.getCoverageFragmentProcessor(i)));
}
fXPFactory.reset(SkSafeRef(paint.getXPFactory()));
@@ -58,17 +58,12 @@ void GrPipelineBuilder::AutoRestoreFragmentProcessorState::set(
if (fPipelineBuilder) {
int m = fPipelineBuilder->numColorFragmentProcessors() - fColorEffectCnt;
SkASSERT(m >= 0);
- for (int i = 0; i < m; ++i) {
- fPipelineBuilder->fColorFragmentProcessors.fromBack(i)->unref();
- }
fPipelineBuilder->fColorFragmentProcessors.pop_back_n(m);
int n = fPipelineBuilder->numCoverageFragmentProcessors() - fCoverageEffectCnt;
SkASSERT(n >= 0);
- for (int i = 0; i < n; ++i) {
- fPipelineBuilder->fCoverageFragmentProcessors.fromBack(i)->unref();
- }
fPipelineBuilder->fCoverageFragmentProcessors.pop_back_n(n);
+
SkDEBUGCODE(--fPipelineBuilder->fBlockEffectRemovalCnt;)
}
fPipelineBuilder = const_cast<GrPipelineBuilder*>(pipelineBuilder);
@@ -83,10 +78,4 @@ void GrPipelineBuilder::AutoRestoreFragmentProcessorState::set(
GrPipelineBuilder::~GrPipelineBuilder() {
SkASSERT(0 == fBlockEffectRemovalCnt);
- for (int i = 0; i < fColorFragmentProcessors.count(); ++i) {
- fColorFragmentProcessors[i]->unref();
- }
- for (int i = 0; i < fCoverageFragmentProcessors.count(); ++i) {
- fCoverageFragmentProcessors[i]->unref();
- }
}
« no previous file with comments | « src/gpu/GrPipelineBuilder.h ('k') | src/gpu/GrProcessorUnitTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698