OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #ifndef GrGLRenderTarget_DEFINED | 9 #ifndef GrGLRenderTarget_DEFINED |
10 #define GrGLRenderTarget_DEFINED | 10 #define GrGLRenderTarget_DEFINED |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 /** When we don't own the FBO ID we don't attempt to modify its attachments.
*/ | 64 /** When we don't own the FBO ID we don't attempt to modify its attachments.
*/ |
65 bool canAttemptStencilAttachment() const override { | 65 bool canAttemptStencilAttachment() const override { |
66 return kCached_LifeCycle == fRTLifecycle || kUncached_LifeCycle == fRTLi
fecycle; | 66 return kCached_LifeCycle == fRTLifecycle || kUncached_LifeCycle == fRTLi
fecycle; |
67 } | 67 } |
68 | 68 |
69 // GrGLRenderTarget overrides dumpMemoryStatistics so it can log its texture
and renderbuffer | 69 // GrGLRenderTarget overrides dumpMemoryStatistics so it can log its texture
and renderbuffer |
70 // components seperately. | 70 // components seperately. |
71 void dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const override
; | 71 void dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const override
; |
72 | 72 |
| 73 /** |
| 74 * @return true if sample locations colocated at pixel center have been set
for this |
| 75 * render target. Requires support for NV_sample_locations. |
| 76 */ |
| 77 bool usesColocatedSampleLocations() const { |
| 78 return fUsesColocatedSampleLocations; |
| 79 } |
| 80 |
| 81 /** |
| 82 * Flag render target as using or not using sample locations colocated at pi
xel center. |
| 83 */ |
| 84 void flagAsUsingColocatedSampleLocations(bool useColocatedSampleLocations) { |
| 85 fUsesColocatedSampleLocations = useColocatedSampleLocations; |
| 86 } |
| 87 |
73 protected: | 88 protected: |
74 // The public constructor registers this object with the cache. However, onl
y the most derived | 89 // The public constructor registers this object with the cache. However, onl
y the most derived |
75 // class should register with the cache. This constructor does not do the re
gistration and | 90 // class should register with the cache. This constructor does not do the re
gistration and |
76 // rather moves that burden onto the derived class. | 91 // rather moves that burden onto the derived class. |
77 enum Derived { kDerived }; | 92 enum Derived { kDerived }; |
78 GrGLRenderTarget(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&, Derived); | 93 GrGLRenderTarget(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&, Derived); |
79 | 94 |
80 void init(const GrSurfaceDesc&, const IDDesc&); | 95 void init(const GrSurfaceDesc&, const IDDesc&); |
81 | 96 |
82 void onAbandon() override; | 97 void onAbandon() override; |
(...skipping 26 matching lines...) Expand all Loading... |
109 | 124 |
110 // when we switch to this render target we want to set the viewport to | 125 // when we switch to this render target we want to set the viewport to |
111 // only render to content area (as opposed to the whole allocation) and | 126 // only render to content area (as opposed to the whole allocation) and |
112 // we want the rendering to be at top left (GL has origin in bottom left) | 127 // we want the rendering to be at top left (GL has origin in bottom left) |
113 GrGLIRect fViewport; | 128 GrGLIRect fViewport; |
114 | 129 |
115 // onGpuMemorySize() needs to know the VRAM footprint of the FBO(s). However
, abandon and | 130 // onGpuMemorySize() needs to know the VRAM footprint of the FBO(s). However
, abandon and |
116 // release zero out the IDs and the cache needs to know the size even after
those actions. | 131 // release zero out the IDs and the cache needs to know the size even after
those actions. |
117 size_t fGpuMemorySize; | 132 size_t fGpuMemorySize; |
118 | 133 |
| 134 // True if sample locations colocated at pixel center are currently in use,
false if default |
| 135 // sample locations are currently in use. |
| 136 bool fUsesColocatedSampleLocations; |
| 137 |
119 typedef GrRenderTarget INHERITED; | 138 typedef GrRenderTarget INHERITED; |
120 }; | 139 }; |
121 | 140 |
122 #endif | 141 #endif |
OLD | NEW |