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

Side by Side Diff: src/gpu/GrResourceProvider.cpp

Issue 1888473002: Use transfer buffer for BatchAtlas texture copies Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase to ToT Created 4 years, 2 months 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/GrGpu.cpp ('k') | src/gpu/batches/GrDrawBatch.h » ('j') | 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 2015 Google Inc. 2 * Copyright 2015 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 #include "GrResourceProvider.h" 8 #include "GrResourceProvider.h"
9 9
10 #include "GrBuffer.h" 10 #include "GrBuffer.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 desc.fConfig = config; 146 desc.fConfig = config;
147 147
148 // We don't want to flush the context so we claim we're in the middle of flu shing so as to 148 // We don't want to flush the context so we claim we're in the middle of flu shing so as to
149 // guarantee we do not recieve a texture with pending IO 149 // guarantee we do not recieve a texture with pending IO
150 // TODO: Determine how to avoid having to do this. (https://bug.skia.org/415 6) 150 // TODO: Determine how to avoid having to do this. (https://bug.skia.org/415 6)
151 static const uint32_t kFlags = GrResourceProvider::kNoPendingIO_Flag; 151 static const uint32_t kFlags = GrResourceProvider::kNoPendingIO_Flag;
152 GrTexture* texture = this->createApproxTexture(desc, kFlags); 152 GrTexture* texture = this->createApproxTexture(desc, kFlags);
153 if (!texture) { 153 if (!texture) {
154 return nullptr; 154 return nullptr;
155 } 155 }
156 GrBatchAtlas* atlas = new GrBatchAtlas(texture, numPlotsX, numPlotsY); 156 GrBatchAtlas* atlas = new GrBatchAtlas(this, texture,
157 numPlotsX, numPlotsY);
157 atlas->registerEvictionCallback(func, data); 158 atlas->registerEvictionCallback(func, data);
158 return atlas; 159 return atlas;
159 } 160 }
160 161
161 GrStencilAttachment* GrResourceProvider::attachStencilAttachment(GrRenderTarget* rt) { 162 GrStencilAttachment* GrResourceProvider::attachStencilAttachment(GrRenderTarget* rt) {
162 SkASSERT(rt); 163 SkASSERT(rt);
163 if (rt->renderTargetPriv().getStencilAttachment()) { 164 if (rt->renderTargetPriv().getStencilAttachment()) {
164 return rt->renderTargetPriv().getStencilAttachment(); 165 return rt->renderTargetPriv().getStencilAttachment();
165 } 166 }
166 167
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 return rt->renderTargetPriv().getStencilAttachment(); 206 return rt->renderTargetPriv().getStencilAttachment();
206 } 207 }
207 208
208 GrRenderTarget* GrResourceProvider::wrapBackendTextureAsRenderTarget( 209 GrRenderTarget* GrResourceProvider::wrapBackendTextureAsRenderTarget(
209 const GrBackendTextureDesc& desc) { 210 const GrBackendTextureDesc& desc) {
210 if (this->isAbandoned()) { 211 if (this->isAbandoned()) {
211 return nullptr; 212 return nullptr;
212 } 213 }
213 return this->gpu()->wrapBackendTextureAsRenderTarget(desc); 214 return this->gpu()->wrapBackendTextureAsRenderTarget(desc);
214 } 215 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/batches/GrDrawBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698