| 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 #ifndef GrProgramElement_DEFINED | 8 #ifndef GrProgramElement_DEFINED |
| 9 #define GrProgramElement_DEFINED | 9 #define GrProgramElement_DEFINED |
| 10 | 10 |
| 11 #include "SkRefCnt.h" | 11 #include "SkRefCnt.h" |
| 12 #include "SkTArray.h" | 12 #include "SkTArray.h" |
| 13 | 13 |
| 14 class GrGpuResourceRef; | 14 class GrGpuResourceRef; |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * Base class for GrEffect (and future GrGeometryProcessor). GrDrawState uses th
is to manage | 17 * Base class for GrProcessor. GrDrawState uses this to manage |
| 18 * transitioning a GrEffect from being owned by a client to being scheduled for
execution. It | 18 * transitioning a GrProcessor from being owned by a client to being scheduled f
or execution. It |
| 19 * converts resources owned by the effect from being ref'ed to having pending re
ads/writes. | 19 * converts resources owned by the effect from being ref'ed to having pending re
ads/writes. |
| 20 * | 20 * |
| 21 * All GrGpuResource objects owned by a GrProgramElement or derived classes (eit
her directly or | 21 * All GrGpuResource objects owned by a GrProgramElement or derived classes (eit
her directly or |
| 22 * indirectly) must be wrapped in a GrGpuResourceRef and registered with the GrP
rogramElement using | 22 * indirectly) must be wrapped in a GrGpuResourceRef and registered with the GrP
rogramElement using |
| 23 * addGpuResource(). This allows the regular refs to be converted to pending IO
events | 23 * addGpuResource(). This allows the regular refs to be converted to pending IO
events |
| 24 * when the program element is scheduled for deferred execution. | 24 * when the program element is scheduled for deferred execution. |
| 25 */ | 25 */ |
| 26 class GrProgramElement : public SkNoncopyable { | 26 class GrProgramElement : public SkNoncopyable { |
| 27 public: | 27 public: |
| 28 SK_DECLARE_INST_COUNT_ROOT(GrProgramElement) | 28 SK_DECLARE_INST_COUNT_ROOT(GrProgramElement) |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 SkSTArray<4, const GrGpuResourceRef*, true> fGpuResources; | 88 SkSTArray<4, const GrGpuResourceRef*, true> fGpuResources; |
| 89 | 89 |
| 90 // Only this class can access convertRefToPendingExecution() and completedEx
ecution(). | 90 // Only this class can access convertRefToPendingExecution() and completedEx
ecution(). |
| 91 template <typename T> friend class GrProgramElementRef; | 91 template <typename T> friend class GrProgramElementRef; |
| 92 | 92 |
| 93 typedef SkNoncopyable INHERITED; | 93 typedef SkNoncopyable INHERITED; |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 #endif | 96 #endif |
| OLD | NEW |