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

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

Issue 1709163003: Add wrapBackendTextureAsRenderTarget API (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Remove assert that is no longer true Created 4 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright 2010 Google Inc. 2 * Copyright 2010 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 #include "GrGpu.h" 9 #include "GrGpu.h"
10 10
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 182
183 GrRenderTarget* GrGpu::wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc, 183 GrRenderTarget* GrGpu::wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc,
184 GrWrapOwnership ownership) { 184 GrWrapOwnership ownership) {
185 if (!this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) { 185 if (!this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) {
186 return nullptr; 186 return nullptr;
187 } 187 }
188 this->handleDirtyContext(); 188 this->handleDirtyContext();
189 return this->onWrapBackendRenderTarget(desc, ownership); 189 return this->onWrapBackendRenderTarget(desc, ownership);
190 } 190 }
191 191
192 GrRenderTarget* GrGpu::wrapBackendTextureAsRenderTarget(const GrBackendTextureDe sc& desc,
193 GrWrapOwnership ownershi p) {
194 this->handleDirtyContext();
195 if (!(desc.fFlags & kRenderTarget_GrBackendTextureFlag)) {
196 return nullptr;
197 }
198 if (!this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) {
199 return nullptr;
200 }
201 return this->onWrapBackendTextureAsRenderTarget(desc, ownership);
202 }
203
192 GrVertexBuffer* GrGpu::createVertexBuffer(size_t size, bool dynamic) { 204 GrVertexBuffer* GrGpu::createVertexBuffer(size_t size, bool dynamic) {
193 this->handleDirtyContext(); 205 this->handleDirtyContext();
194 GrVertexBuffer* vb = this->onCreateVertexBuffer(size, dynamic); 206 GrVertexBuffer* vb = this->onCreateVertexBuffer(size, dynamic);
195 if (!this->caps()->reuseScratchBuffers()) { 207 if (!this->caps()->reuseScratchBuffers()) {
196 vb->resourcePriv().removeScratchKey(); 208 vb->resourcePriv().removeScratchKey();
197 } 209 }
198 return vb; 210 return vb;
199 } 211 }
200 212
201 GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) { 213 GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) {
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 } 390 }
379 391
380 GrVertices::Iterator iter; 392 GrVertices::Iterator iter;
381 const GrNonInstancedVertices* verts = iter.init(vertices); 393 const GrNonInstancedVertices* verts = iter.init(vertices);
382 do { 394 do {
383 this->onDraw(args, *verts); 395 this->onDraw(args, *verts);
384 fStats.incNumDraws(); 396 fStats.incNumDraws();
385 } while ((verts = iter.next())); 397 } while ((verts = iter.next()));
386 } 398 }
387 399
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698