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

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

Issue 2262473003: Define clear regions in terms of GrFixedClip (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_fixedcliptosrc
Patch Set: disabled -> Disabled Created 4 years, 4 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 #include "GrDrawTarget.h" 8 #include "GrDrawTarget.h"
9 9
10 #include "GrAppliedClip.h" 10 #include "GrAppliedClip.h"
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 // remove all the previously recorded batches and change the load op to clea r with supplied 451 // remove all the previously recorded batches and change the load op to clea r with supplied
452 // color. 452 // color.
453 if (fLastFullClearBatch && 453 if (fLastFullClearBatch &&
454 fLastFullClearBatch->renderTargetUniqueID() == renderTarget->getUniqueID ()) { 454 fLastFullClearBatch->renderTargetUniqueID() == renderTarget->getUniqueID ()) {
455 // As currently implemented, fLastFullClearBatch should be the last batc h because we would 455 // As currently implemented, fLastFullClearBatch should be the last batc h because we would
456 // have cleared it when another batch was recorded. 456 // have cleared it when another batch was recorded.
457 SkASSERT(fRecordedBatches.back().fBatch.get() == fLastFullClearBatch); 457 SkASSERT(fRecordedBatches.back().fBatch.get() == fLastFullClearBatch);
458 fLastFullClearBatch->setColor(color); 458 fLastFullClearBatch->setColor(color);
459 return; 459 return;
460 } 460 }
461 sk_sp<GrClearBatch> batch(GrClearBatch::Make(SkIRect::MakeWH(renderTarget->w idth(), 461 sk_sp<GrClearBatch> batch(GrClearBatch::Make(GrFixedClip::Disabled(), color, renderTarget));
462 renderTarget->h eight()),
463 color, renderTarget));
464 if (batch.get() == this->recordBatch(batch.get(), batch->bounds())) { 462 if (batch.get() == this->recordBatch(batch.get(), batch->bounds())) {
465 fLastFullClearBatch = batch.get(); 463 fLastFullClearBatch = batch.get();
466 } 464 }
467 } 465 }
468 466
469 void GrDrawTarget::discard(GrRenderTarget* renderTarget) { 467 void GrDrawTarget::discard(GrRenderTarget* renderTarget) {
470 // Currently this just inserts a discard batch. However, once in MDB this ca n remove all the 468 // Currently this just inserts a discard batch. However, once in MDB this ca n remove all the
471 // previously recorded batches and change the load op to discard. 469 // previously recorded batches and change the load op to discard.
472 if (this->caps()->discardRenderTargetSupport()) { 470 if (this->caps()->discardRenderTargetSupport()) {
473 GrBatch* batch = new GrDiscardBatch(renderTarget); 471 GrBatch* batch = new GrDiscardBatch(renderTarget);
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 if (j > maxCandidateIdx) { 606 if (j > maxCandidateIdx) {
609 GrBATCH_INFO("\t\tReached max lookahead or end of batch array %d \n", i); 607 GrBATCH_INFO("\t\tReached max lookahead or end of batch array %d \n", i);
610 break; 608 break;
611 } 609 }
612 } 610 }
613 } 611 }
614 } 612 }
615 613
616 /////////////////////////////////////////////////////////////////////////////// 614 ///////////////////////////////////////////////////////////////////////////////
617 615
618 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend erTarget* rt) { 616 void GrDrawTarget::clearStencilClip(const GrFixedClip& clip,
619 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); 617 bool insideStencilMask,
618 GrRenderTarget* rt) {
619 GrBatch* batch = new GrClearStencilClipBatch(clip, insideStencilMask, rt);
620 this->recordBatch(batch, batch->bounds()); 620 this->recordBatch(batch, batch->bounds());
621 batch->unref(); 621 batch->unref();
622 } 622 }
OLDNEW
« src/gpu/GrDrawContext.cpp ('K') | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrFixedClip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698