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

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

Issue 537773004: Add GrProgramElement base class for GrEffect with deferred exec ref. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 6 years, 3 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 | « include/gpu/GrProgramResource.h ('k') | src/gpu/GrProgramResource.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8
9 #include "GrProgramElement.h"
10 #include "GrProgramResource.h"
11
12 void GrProgramElement::convertRefToPendingExecution() const {
13 // This function makes it so that all the GrProgramResources own a single re f to their
14 // underlying GrGpuResource if there are any refs to the GrProgramElement an d a single
15 // pending read/write if there are any pending executions of the GrProgramEl ement. The
16 // GrProgramResource will give up its single ref and/or pending read/write i n its destructor.
17 SkASSERT(fRefCnt > 0);
18 if (0 == fPendingExecutions) {
19 for (int i = 0; i < fProgramResources.count(); ++i) {
20 fProgramResources[i]->markPendingIO();
21 }
22 }
23 ++fPendingExecutions;
24 this->unref();
25 if (0 == fRefCnt) {
26 for (int i = 0; i < fProgramResources.count(); ++i) {
27 fProgramResources[i]->removeRef();
28 }
29 }
30 }
OLDNEW
« no previous file with comments | « include/gpu/GrProgramResource.h ('k') | src/gpu/GrProgramResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698