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

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

Issue 2138083002: skip call to clip::apply when clip is wide open Base URL: https://chromium.googlesource.com/skia.git@llist
Patch Set: rm gcmm Created 4 years, 5 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/GrClipStackClip.cpp ('k') | src/gpu/GrProcessor.cpp » ('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 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 "GrAuditTrail.h" 10 #include "GrAuditTrail.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 } 322 }
323 323
324 void GrDrawTarget::drawBatch(const GrPipelineBuilder& pipelineBuilder, 324 void GrDrawTarget::drawBatch(const GrPipelineBuilder& pipelineBuilder,
325 GrDrawContext* drawContext, 325 GrDrawContext* drawContext,
326 const GrClip& clip, 326 const GrClip& clip,
327 GrDrawBatch* batch) { 327 GrDrawBatch* batch) {
328 // Setup clip 328 // Setup clip
329 GrAppliedClip appliedClip; 329 GrAppliedClip appliedClip;
330 SkRect bounds; 330 SkRect bounds;
331 batch_bounds(&bounds, batch); 331 batch_bounds(&bounds, batch);
332 if (!clip.apply(fContext, pipelineBuilder, drawContext, &bounds, &appliedCli p)) { 332 if (!clip.isWideOpen() && !clip.apply(fContext, pipelineBuilder, drawContext , &bounds, &appliedClip)) {
333 return; 333 return;
334 } 334 }
335 335
336 // TODO: this is the only remaining usage of the AutoRestoreFragmentProcesso rState - remove it 336 // TODO: this is the only remaining usage of the AutoRestoreFragmentProcesso rState - remove it
337 GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps; 337 GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps;
338 if (appliedClip.getClipCoverageFragmentProcessor()) { 338 if (appliedClip.getClipCoverageFragmentProcessor()) {
339 arfps.set(&pipelineBuilder); 339 arfps.set(&pipelineBuilder);
340 arfps.addCoverageFragmentProcessor(sk_ref_sp(appliedClip.getClipCoverage FragmentProcessor())); 340 arfps.addCoverageFragmentProcessor(sk_ref_sp(appliedClip.getClipCoverage FragmentProcessor()));
341 } 341 }
342 342
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 } 626 }
627 } 627 }
628 628
629 /////////////////////////////////////////////////////////////////////////////// 629 ///////////////////////////////////////////////////////////////////////////////
630 630
631 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend erTarget* rt) { 631 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend erTarget* rt) {
632 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); 632 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt);
633 this->recordBatch(batch, batch->bounds()); 633 this->recordBatch(batch, batch->bounds());
634 batch->unref(); 634 batch->unref();
635 } 635 }
OLDNEW
« no previous file with comments | « src/gpu/GrClipStackClip.cpp ('k') | src/gpu/GrProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698