diff options
author | 2011-03-08 21:07:21 +0000 | |
---|---|---|
committer | 2011-03-08 21:07:21 +0000 | |
commit | 0b50b2ed462505c452de8b6d978c4e522e0f9fe1 (patch) | |
tree | 23e88cf6ddd3cc8ec9c25b8102ce10462ff91a14 /gpu/src/GrGpu.cpp | |
parent | eb3828e29da07375dac4edb78eadd457a15fa874 (diff) |
If we compute an exact clip bounds prefer it over user passed bounds. Also clarify that bounds are conservative.
Review URL: http://codereview.appspot.com/4254063/
git-svn-id: http://skia.googlecode.com/svn/trunk@909 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/src/GrGpu.cpp')
-rw-r--r-- | gpu/src/GrGpu.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gpu/src/GrGpu.cpp b/gpu/src/GrGpu.cpp index 4a46e9887d..045dcd00b6 100644 --- a/gpu/src/GrGpu.cpp +++ b/gpu/src/GrGpu.cpp @@ -295,8 +295,8 @@ bool GrGpu::setupClipAndFlushState(GrPrimitiveType type) { GrRect rtRect; rtRect.setLTRB(0, 0, GrIntToScalar(rt.width()), GrIntToScalar(rt.height())); - if (fClip.hasBounds()) { - bounds = fClip.getBounds(); + if (fClip.hasConservativeBounds()) { + bounds = fClip.getConservativeBounds(); bounds.intersectWith(rtRect); } else { bounds = rtRect; @@ -342,13 +342,13 @@ bool GrGpu::setupClipAndFlushState(GrPrimitiveType type) { // the full rt size and another element intersected with it. // We can skip the first full-size rect and save a big rect draw. int firstElement = 0; - if (clip.getElementCount() > 1 && + if (clip.getElementCount() > 1 && kRect_ClipType == clip.getElementType(0) && kIntersect_SetOp == clip.getOp(1)&& clip.getRect(0).contains(bounds)) { firstElement = 1; } - + // walk through each clip element and perform its set op // with the existing clip. for (int c = firstElement; c < count; ++c) { @@ -390,8 +390,8 @@ bool GrGpu::setupClipAndFlushState(GrPrimitiveType type) { this->drawSimpleRect(clip.getRect(c), NULL, 0); } else { SET_RANDOM_COLOR - getPathRenderer()->drawPathToStencil(this, clip.getPath(c), - NonInvertedFill(fill), + getPathRenderer()->drawPathToStencil(this, clip.getPath(c), + NonInvertedFill(fill), NULL); } } @@ -408,7 +408,7 @@ bool GrGpu::setupClipAndFlushState(GrPrimitiveType type) { } else { SET_RANDOM_COLOR getPathRenderer()->drawPath(this, 0, - clip.getPath(c), + clip.getPath(c), fill, NULL); } } else { |