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

Side by Side Diff: tests/ProxyRefTest.cpp

Issue 2514543002: Defer more renderTargetContexts in the GPU image filter paths - take 2 (Closed)
Patch Set: Add more bullet proofing Created 4 years, 1 month 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 | « src/gpu/GrContext.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698