| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrSoftwarePathRenderer.h" | 9 #include "GrSoftwarePathRenderer.h" |
| 10 #include "GrContext.h" | 10 #include "GrContext.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 const SkIRect& devPathBounds) { | 87 const SkIRect& devPathBounds) { |
| 88 SkMatrix invert; | 88 SkMatrix invert; |
| 89 if (!viewMatrix.invert(&invert)) { | 89 if (!viewMatrix.invert(&invert)) { |
| 90 return; | 90 return; |
| 91 } | 91 } |
| 92 | 92 |
| 93 SkRect rect; | 93 SkRect rect; |
| 94 if (devClipBounds.fTop < devPathBounds.fTop) { | 94 if (devClipBounds.fTop < devPathBounds.fTop) { |
| 95 rect.iset(devClipBounds.fLeft, devClipBounds.fTop, | 95 rect.iset(devClipBounds.fLeft, devClipBounds.fTop, |
| 96 devClipBounds.fRight, devPathBounds.fTop); | 96 devClipBounds.fRight, devPathBounds.fTop); |
| 97 target->drawRect(pipelineBuilder, color, SkMatrix::I(), rect, NULL, &inv
ert); | 97 target->drawBWRect(pipelineBuilder, color, SkMatrix::I(), rect, NULL, &i
nvert); |
| 98 } | 98 } |
| 99 if (devClipBounds.fLeft < devPathBounds.fLeft) { | 99 if (devClipBounds.fLeft < devPathBounds.fLeft) { |
| 100 rect.iset(devClipBounds.fLeft, devPathBounds.fTop, | 100 rect.iset(devClipBounds.fLeft, devPathBounds.fTop, |
| 101 devPathBounds.fLeft, devPathBounds.fBottom); | 101 devPathBounds.fLeft, devPathBounds.fBottom); |
| 102 target->drawRect(pipelineBuilder, color, SkMatrix::I(), rect, NULL, &inv
ert); | 102 target->drawBWRect(pipelineBuilder, color, SkMatrix::I(), rect, NULL, &i
nvert); |
| 103 } | 103 } |
| 104 if (devClipBounds.fRight > devPathBounds.fRight) { | 104 if (devClipBounds.fRight > devPathBounds.fRight) { |
| 105 rect.iset(devPathBounds.fRight, devPathBounds.fTop, | 105 rect.iset(devPathBounds.fRight, devPathBounds.fTop, |
| 106 devClipBounds.fRight, devPathBounds.fBottom); | 106 devClipBounds.fRight, devPathBounds.fBottom); |
| 107 target->drawRect(pipelineBuilder, color, SkMatrix::I(), rect, NULL, &inv
ert); | 107 target->drawBWRect(pipelineBuilder, color, SkMatrix::I(), rect, NULL, &i
nvert); |
| 108 } | 108 } |
| 109 if (devClipBounds.fBottom > devPathBounds.fBottom) { | 109 if (devClipBounds.fBottom > devPathBounds.fBottom) { |
| 110 rect.iset(devClipBounds.fLeft, devPathBounds.fBottom, | 110 rect.iset(devClipBounds.fLeft, devPathBounds.fBottom, |
| 111 devClipBounds.fRight, devClipBounds.fBottom); | 111 devClipBounds.fRight, devClipBounds.fBottom); |
| 112 target->drawRect(pipelineBuilder, color, SkMatrix::I(), rect, NULL, &inv
ert); | 112 target->drawBWRect(pipelineBuilder, color, SkMatrix::I(), rect, NULL, &i
nvert); |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 | 115 |
| 116 } | 116 } |
| 117 | 117 |
| 118 //////////////////////////////////////////////////////////////////////////////// | 118 //////////////////////////////////////////////////////////////////////////////// |
| 119 // return true on success; false on failure | 119 // return true on success; false on failure |
| 120 bool GrSoftwarePathRenderer::onDrawPath(GrDrawTarget* target, | 120 bool GrSoftwarePathRenderer::onDrawPath(GrDrawTarget* target, |
| 121 GrPipelineBuilder* pipelineBuilder, | 121 GrPipelineBuilder* pipelineBuilder, |
| 122 GrColor color, | 122 GrColor color, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 150 GrSWMaskHelper::DrawToTargetWithPathMask(texture, target, ©, color, view
Matrix, | 150 GrSWMaskHelper::DrawToTargetWithPathMask(texture, target, ©, color, view
Matrix, |
| 151 devPathBounds); | 151 devPathBounds); |
| 152 | 152 |
| 153 if (path.isInverseFillType()) { | 153 if (path.isInverseFillType()) { |
| 154 draw_around_inv_path(target, pipelineBuilder, color, viewMatrix, devClip
Bounds, | 154 draw_around_inv_path(target, pipelineBuilder, color, viewMatrix, devClip
Bounds, |
| 155 devPathBounds); | 155 devPathBounds); |
| 156 } | 156 } |
| 157 | 157 |
| 158 return true; | 158 return true; |
| 159 } | 159 } |
| OLD | NEW |