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

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

Issue 1117433002: Remove GrFlushToGpuDrawTarget and move functionality up to GrDrawTarget. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more Created 5 years, 7 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/GrInOrderDrawBuffer.h ('k') | src/gpu/GrTargetCommands.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 2011 Google Inc. 2 * Copyright 2011 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 "GrInOrderDrawBuffer.h" 8 #include "GrInOrderDrawBuffer.h"
9 9
10 #include "GrDefaultGeoProcFactory.h" 10 #include "GrDefaultGeoProcFactory.h"
11 #include "GrTemplates.h" 11 #include "GrTemplates.h"
12 12
13 GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrGpu* gpu, 13 GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrContext* context,
14 GrVertexBufferAllocPool* vertexPool, 14 GrVertexBufferAllocPool* vertexPool,
15 GrIndexBufferAllocPool* indexPool) 15 GrIndexBufferAllocPool* indexPool)
16 : INHERITED(gpu, vertexPool, indexPool) 16 : INHERITED(context, vertexPool, indexPool)
17 , fCommands(gpu, vertexPool, indexPool) 17 , fCommands(context->getGpu(), vertexPool, indexPool)
18 , fPathIndexBuffer(kPathIdxBufferMinReserve * sizeof(char)/4) 18 , fPathIndexBuffer(kPathIdxBufferMinReserve * sizeof(char)/4)
19 , fPathTransformBuffer(kPathXformBufferMinReserve * sizeof(float)/4) 19 , fPathTransformBuffer(kPathXformBufferMinReserve * sizeof(float)/4)
20 , fDrawID(0) { 20 , fDrawID(0) {
21 21
22 SkASSERT(vertexPool); 22 SkASSERT(vertexPool);
23 SkASSERT(indexPool); 23 SkASSERT(indexPool);
24 } 24 }
25 25
26 GrInOrderDrawBuffer::~GrInOrderDrawBuffer() { 26 GrInOrderDrawBuffer::~GrInOrderDrawBuffer() {
27 this->reset(); 27 this->reset();
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 fPathIndexBuffer.rewind(); 369 fPathIndexBuffer.rewind();
370 fPathTransformBuffer.rewind(); 370 fPathTransformBuffer.rewind();
371 fGpuCmdMarkers.reset(); 371 fGpuCmdMarkers.reset();
372 } 372 }
373 373
374 void GrInOrderDrawBuffer::onFlush() { 374 void GrInOrderDrawBuffer::onFlush() {
375 fCommands.flush(this); 375 fCommands.flush(this);
376 ++fDrawID; 376 ++fDrawID;
377 } 377 }
378 378
379 bool GrInOrderDrawBuffer::onCopySurface(GrSurface* dst, 379 void GrInOrderDrawBuffer::onCopySurface(GrSurface* dst,
380 GrSurface* src, 380 GrSurface* src,
381 const SkIRect& srcRect, 381 const SkIRect& srcRect,
382 const SkIPoint& dstPoint) { 382 const SkIPoint& dstPoint) {
383 GrTargetCommands::Cmd* cmd = fCommands.recordCopySurface(this, dst, src, 383 SkASSERT(this->getGpu()->canCopySurface(dst, src, srcRect, dstPoint));
384 srcRect, dstPoint); 384 GrTargetCommands::Cmd* cmd = fCommands.recordCopySurface(dst, src, srcRect, dstPoint);
385 this->recordTraceMarkersIfNecessary(cmd); 385 this->recordTraceMarkersIfNecessary(cmd);
386 return SkToBool(cmd);
387 } 386 }
388 387
389 void GrInOrderDrawBuffer::recordTraceMarkersIfNecessary(GrTargetCommands::Cmd* c md) { 388 void GrInOrderDrawBuffer::recordTraceMarkersIfNecessary(GrTargetCommands::Cmd* c md) {
390 if (!cmd) { 389 if (!cmd) {
391 return; 390 return;
392 } 391 }
393 const GrTraceMarkerSet& activeTraceMarkers = this->getActiveTraceMarkers(); 392 const GrTraceMarkerSet& activeTraceMarkers = this->getActiveTraceMarkers();
394 if (activeTraceMarkers.count() > 0) { 393 if (activeTraceMarkers.count() > 0) {
395 if (cmd->isTraced()) { 394 if (cmd->isTraced()) {
396 fGpuCmdMarkers[cmd->markerID()].addSet(activeTraceMarkers); 395 fGpuCmdMarkers[cmd->markerID()].addSet(activeTraceMarkers);
397 } else { 396 } else {
398 cmd->setMarkerID(fGpuCmdMarkers.count()); 397 cmd->setMarkerID(fGpuCmdMarkers.count());
399 fGpuCmdMarkers.push_back(activeTraceMarkers); 398 fGpuCmdMarkers.push_back(activeTraceMarkers);
400 } 399 }
401 } 400 }
402 } 401 }
OLDNEW
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.h ('k') | src/gpu/GrTargetCommands.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698