OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 | |
9 #include "GrProgramElement.h" | 8 #include "GrProgramElement.h" |
10 #include "GrProgramResource.h" | 9 #include "GrProgramResource.h" |
11 | 10 |
12 void GrProgramElement::convertRefToPendingExecution() const { | 11 void GrProgramElement::convertRefToPendingExecution() const { |
13 // This function makes it so that all the GrProgramResources own a single re
f to their | 12 // 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 | 13 // underlying GrGpuResource if there are any refs to the GrProgramElement an
d a single |
15 // pending read if there are any pending executions of the GrProgramElement.
The | 14 // pending read if there are any pending executions of the GrProgramElement.
The |
16 // GrProgramResource will give up its single ref and/or pending read in its
destructor. | 15 // GrProgramResource will give up its single ref and/or pending read in its
destructor. |
17 SkASSERT(fRefCnt > 0); | 16 SkASSERT(fRefCnt > 0); |
18 if (0 == fPendingExecutions) { | 17 if (0 == fPendingExecutions) { |
(...skipping 19 matching lines...) Expand all Loading... |
38 } else { | 37 } else { |
39 // Now our pending executions have ocurred and we still have refs. C
onvert | 38 // Now our pending executions have ocurred and we still have refs. C
onvert |
40 // ownership of our resources back to regular refs. | 39 // ownership of our resources back to regular refs. |
41 for (int i = 0; i < fProgramResources.count(); ++i) { | 40 for (int i = 0; i < fProgramResources.count(); ++i) { |
42 fProgramResources[i]->pendingIOComplete(); | 41 fProgramResources[i]->pendingIOComplete(); |
43 } | 42 } |
44 | 43 |
45 } | 44 } |
46 } | 45 } |
47 } | 46 } |
OLD | NEW |