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

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

Issue 1534123003: More framework support for TransferBuffers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "GrGpu.h" 10 #include "GrGpu.h"
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 } 329 }
330 330
331 this->handleDirtyContext(); 331 this->handleDirtyContext();
332 if (this->onWritePixels(surface, left, top, width, height, config, buffer, r owBytes)) { 332 if (this->onWritePixels(surface, left, top, width, height, config, buffer, r owBytes)) {
333 fStats.incTextureUploads(); 333 fStats.incTextureUploads();
334 return true; 334 return true;
335 } 335 }
336 return false; 336 return false;
337 } 337 }
338 338
339 bool GrGpu::transferPixels(GrSurface* surface,
340 int left, int top, int width, int height,
341 GrPixelConfig config, GrTransferBuffer* buffer,
342 size_t offset, size_t rowBytes) {
343 if (!buffer) {
bsalomon 2015/12/18 15:24:38 || !surface?
jvanverth1 2016/01/04 21:24:09 Done.
344 return false;
345 }
346
347 this->handleDirtyContext();
348 if (this->onTransferPixels(surface, left, top, width, height, config,
349 buffer, offset, rowBytes)) {
350 fStats.incTextureUploads();
bsalomon 2015/12/18 15:24:38 Worth tracking transfers differently from uploads?
jvanverth1 2016/01/04 21:24:09 Done.
351 return true;
352 }
353 return false;
354 }
355
339 void GrGpu::resolveRenderTarget(GrRenderTarget* target) { 356 void GrGpu::resolveRenderTarget(GrRenderTarget* target) {
340 SkASSERT(target); 357 SkASSERT(target);
341 this->handleDirtyContext(); 358 this->handleDirtyContext();
342 this->onResolveRenderTarget(target); 359 this->onResolveRenderTarget(target);
343 } 360 }
344 361
345 //////////////////////////////////////////////////////////////////////////////// 362 ////////////////////////////////////////////////////////////////////////////////
346 363
347 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) { 364 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) {
348 this->handleDirtyContext(); 365 this->handleDirtyContext();
349 if (GrXferBarrierType barrierType = args.fPipeline->xferBarrierType(*this->c aps())) { 366 if (GrXferBarrierType barrierType = args.fPipeline->xferBarrierType(*this->c aps())) {
350 this->xferBarrier(args.fPipeline->getRenderTarget(), barrierType); 367 this->xferBarrier(args.fPipeline->getRenderTarget(), barrierType);
351 } 368 }
352 369
353 GrVertices::Iterator iter; 370 GrVertices::Iterator iter;
354 const GrNonInstancedVertices* verts = iter.init(vertices); 371 const GrNonInstancedVertices* verts = iter.init(vertices);
355 do { 372 do {
356 this->onDraw(args, *verts); 373 this->onDraw(args, *verts);
357 fStats.incNumDraws(); 374 fStats.incNumDraws();
358 } while ((verts = iter.next())); 375 } while ((verts = iter.next()));
359 } 376 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrResourceProvider.h » ('j') | src/gpu/GrResourceProvider.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698