OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 // This is a GPU-backend specific test. | 8 // This is a GPU-backend specific test. |
9 | 9 |
10 #include "Test.h" | 10 #include "Test.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 sk_sp<GrSurfaceProxy> sProxy((*make)(caps, provider)); | 99 sk_sp<GrSurfaceProxy> sProxy((*make)(caps, provider)); |
100 | 100 |
101 GrPendingIOResource<GrSurfaceProxy, kWrite_GrIOType> fWrite(sProxy.g
et()); | 101 GrPendingIOResource<GrSurfaceProxy, kWrite_GrIOType> fWrite(sProxy.g
et()); |
102 | 102 |
103 check_refs(reporter, sProxy.get(), 1, 1, 0, 1); | 103 check_refs(reporter, sProxy.get(), 1, 1, 0, 1); |
104 | 104 |
105 // In the deferred case, the discard batch created on instantiation
adds an | 105 // In the deferred case, the discard batch created on instantiation
adds an |
106 // extra ref and write | 106 // extra ref and write |
107 bool proxyGetsDiscardRef = !sProxy->isWrapped_ForTesting() && | 107 bool proxyGetsDiscardRef = !sProxy->isWrapped_ForTesting() && |
108 caps.discardRenderTargetSupport(); | 108 caps.discardRenderTargetSupport(); |
109 » int expectedWrites = proxyGetsDiscardRef ? 2 : 1; | 109 int expectedWrites = proxyGetsDiscardRef ? 2 : 1; |
110 | 110 |
111 sProxy->instantiate(provider); | 111 sProxy->instantiate(provider); |
112 | 112 |
113 // In the deferred case, this checks that the refs transfered to the
GrSurface | 113 // In the deferred case, this checks that the refs transfered to the
GrSurface |
114 check_refs(reporter, sProxy.get(), 1, 1, 0, expectedWrites); | 114 check_refs(reporter, sProxy.get(), 1, 1, 0, expectedWrites); |
115 } | 115 } |
116 | 116 |
117 // A single read | 117 // A single read |
118 { | 118 { |
119 sk_sp<GrSurfaceProxy> sProxy((*make)(caps, provider)); | 119 sk_sp<GrSurfaceProxy> sProxy((*make)(caps, provider)); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 sProxy->unref(); | 196 sProxy->unref(); |
197 check_refs(reporter, sProxy.get(), 1, 1, 0, expectedWrites); | 197 check_refs(reporter, sProxy.get(), 1, 1, 0, expectedWrites); |
198 | 198 |
199 GrPendingIOResource<GrSurfaceProxy, kRead_GrIOType> fRead(sProxy.get
()); | 199 GrPendingIOResource<GrSurfaceProxy, kRead_GrIOType> fRead(sProxy.get
()); |
200 check_refs(reporter, sProxy.get(), 1, 1, 1, expectedWrites); | 200 check_refs(reporter, sProxy.get(), 1, 1, 1, expectedWrites); |
201 } | 201 } |
202 } | 202 } |
203 } | 203 } |
204 | 204 |
205 #endif | 205 #endif |
OLD | NEW |