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

Side by Side Diff: src/core/SkClipStack.cpp

Issue 877473005: Add device space "nudge" to gpu draws Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix 'f' again Created 5 years, 10 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 | « samplecode/SampleClipDrawMatch.cpp ('k') | src/gpu/effects/GrConvexPolyEffect.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 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkClipStack.h" 9 #include "SkClipStack.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 fFiniteBoundType = kInsideOut_BoundsType; 411 fFiniteBoundType = kInsideOut_BoundsType;
412 } else { 412 } else {
413 fFiniteBoundType = kNormal_BoundsType; 413 fFiniteBoundType = kNormal_BoundsType;
414 } 414 }
415 break; 415 break;
416 case kEmpty_Type: 416 case kEmpty_Type:
417 SkDEBUGFAIL("We shouldn't get here with an empty element."); 417 SkDEBUGFAIL("We shouldn't get here with an empty element.");
418 break; 418 break;
419 } 419 }
420 420
421 if (!fDoAA) {
422 // Here we mimic a non-anti-aliased scanline system. If there is
423 // no anti-aliasing we can integerize the bounding box to exclude
424 // fractional parts that won't be rendered.
425 // Note: the left edge is handled slightly differently below. We
426 // are a bit more generous in the rounding since we don't want to
427 // risk missing the left pixels when fLeft is very close to .5
428 fFiniteBound.set(SkScalarFloorToScalar(fFiniteBound.fLeft+0.45f),
429 SkScalarRoundToScalar(fFiniteBound.fTop),
430 SkScalarRoundToScalar(fFiniteBound.fRight),
431 SkScalarRoundToScalar(fFiniteBound.fBottom));
432 }
433
434 // Now determine the previous Element's bound information taking into 421 // Now determine the previous Element's bound information taking into
435 // account that there may be no previous clip 422 // account that there may be no previous clip
436 SkRect prevFinite; 423 SkRect prevFinite;
437 SkClipStack::BoundsType prevType; 424 SkClipStack::BoundsType prevType;
438 425
439 if (NULL == prior) { 426 if (NULL == prior) {
440 // no prior clip means the entire plane is writable 427 // no prior clip means the entire plane is writable
441 prevFinite.setEmpty(); // there are no pixels that cannot be drawn to 428 prevFinite.setEmpty(); // there are no pixels that cannot be drawn to
442 prevType = kInsideOut_BoundsType; 429 prevType = kInsideOut_BoundsType;
443 } else { 430 } else {
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 888
902 void SkClipStack::dump() const { 889 void SkClipStack::dump() const {
903 B2TIter iter(*this); 890 B2TIter iter(*this);
904 const Element* e; 891 const Element* e;
905 while ((e = iter.next())) { 892 while ((e = iter.next())) {
906 e->dump(); 893 e->dump();
907 SkDebugf("\n"); 894 SkDebugf("\n");
908 } 895 }
909 } 896 }
910 #endif 897 #endif
OLDNEW
« no previous file with comments | « samplecode/SampleClipDrawMatch.cpp ('k') | src/gpu/effects/GrConvexPolyEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698