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

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

Issue 770813002: move some copy surface stuff to GrFlushToGpuDrawTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@playback
Patch Set: Created 6 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
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.h ('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 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"
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 if (getGpu()->canCopySurface(dst, src, srcRect, dstPoint)) { 474 if (getGpu()->canCopySurface(dst, src, srcRect, dstPoint)) {
475 CopySurface* cs = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, CopySurface, (dst , src)); 475 CopySurface* cs = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, CopySurface, (dst , src));
476 cs->fSrcRect = srcRect; 476 cs->fSrcRect = srcRect;
477 cs->fDstPoint = dstPoint; 477 cs->fDstPoint = dstPoint;
478 this->recordTraceMarkersIfNecessary(); 478 this->recordTraceMarkersIfNecessary();
479 return true; 479 return true;
480 } 480 }
481 return false; 481 return false;
482 } 482 }
483 483
484 bool GrInOrderDrawBuffer::onCanCopySurface(const GrSurface* dst,
485 const GrSurface* src,
486 const SkIRect& srcRect,
487 const SkIPoint& dstPoint) {
488 return getGpu()->canCopySurface(dst, src, srcRect, dstPoint);
489 }
490
491 bool GrInOrderDrawBuffer::onInitCopySurfaceDstDesc(const GrSurface* src, GrSurfa ceDesc* desc) {
492 return getGpu()->initCopySurfaceDstDesc(src, desc);
493 }
494
495 bool GrInOrderDrawBuffer::recordStateAndShouldDraw(const GrDrawState& ds, 484 bool GrInOrderDrawBuffer::recordStateAndShouldDraw(const GrDrawState& ds,
496 GrGpu::DrawType drawType, 485 GrGpu::DrawType drawType,
497 const GrClipMaskManager::Scis sorState& scissor, 486 const GrClipMaskManager::Scis sorState& scissor,
498 const GrDeviceCoordTexture* d stCopy) { 487 const GrDeviceCoordTexture* d stCopy) {
499 SetState* ss = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, SetState, 488 SetState* ss = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, SetState,
500 (ds, this->getGpu(), scissor, dstCop y, drawType)); 489 (ds, this->getGpu(), scissor, dstCop y, drawType));
501 if (ss->fState.mustSkip()) { 490 if (ss->fState.mustSkip()) {
502 fCmdBuffer.pop_back(); 491 fCmdBuffer.pop_back();
503 return false; 492 return false;
504 } 493 }
505 if (fPrevState && *fPrevState == ss->fState) { 494 if (fPrevState && *fPrevState == ss->fState) {
506 fCmdBuffer.pop_back(); 495 fCmdBuffer.pop_back();
507 } else { 496 } else {
508 fPrevState = &ss->fState; 497 fPrevState = &ss->fState;
509 this->recordTraceMarkersIfNecessary(); 498 this->recordTraceMarkersIfNecessary();
510 } 499 }
511 return true; 500 return true;
512 } 501 }
513 502
514 void GrInOrderDrawBuffer::recordTraceMarkersIfNecessary() { 503 void GrInOrderDrawBuffer::recordTraceMarkersIfNecessary() {
515 SkASSERT(!fCmdBuffer.empty()); 504 SkASSERT(!fCmdBuffer.empty());
516 SkASSERT(!cmd_has_trace_marker(fCmdBuffer.back().fType)); 505 SkASSERT(!cmd_has_trace_marker(fCmdBuffer.back().fType));
517 const GrTraceMarkerSet& activeTraceMarkers = this->getActiveTraceMarkers(); 506 const GrTraceMarkerSet& activeTraceMarkers = this->getActiveTraceMarkers();
518 if (activeTraceMarkers.count() > 0) { 507 if (activeTraceMarkers.count() > 0) {
519 fCmdBuffer.back().fType = add_trace_bit(fCmdBuffer.back().fType); 508 fCmdBuffer.back().fType = add_trace_bit(fCmdBuffer.back().fType);
520 fGpuCmdMarkers.push_back(activeTraceMarkers); 509 fGpuCmdMarkers.push_back(activeTraceMarkers);
521 } 510 }
522 } 511 }
OLDNEW
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698