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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 *devPathBounds = GrIRect::EmptyIRect(); | 75 *devPathBounds = GrIRect::EmptyIRect(); |
76 return false; | 76 return false; |
77 } | 77 } |
78 return true; | 78 return true; |
79 } | 79 } |
80 | 80 |
81 //////////////////////////////////////////////////////////////////////////////// | 81 //////////////////////////////////////////////////////////////////////////////// |
82 void draw_around_inv_path(GrDrawTarget* target, | 82 void draw_around_inv_path(GrDrawTarget* target, |
83 const GrIRect& devClipBounds, | 83 const GrIRect& devClipBounds, |
84 const GrIRect& devPathBounds) { | 84 const GrIRect& devPathBounds) { |
85 GrDrawState::AutoDeviceCoordDraw adcd(target->drawState()); | 85 GrDrawState::AutoViewMatrixRestore avmr; |
86 if (!adcd.succeeded()) { | 86 if (!avmr.setIdentity(target->drawState())) { |
87 return; | 87 return; |
88 } | 88 } |
89 GrRect rect; | 89 GrRect rect; |
90 if (devClipBounds.fTop < devPathBounds.fTop) { | 90 if (devClipBounds.fTop < devPathBounds.fTop) { |
91 rect.iset(devClipBounds.fLeft, devClipBounds.fTop, | 91 rect.iset(devClipBounds.fLeft, devClipBounds.fTop, |
92 devClipBounds.fRight, devPathBounds.fTop); | 92 devClipBounds.fRight, devPathBounds.fTop); |
93 target->drawSimpleRect(rect, NULL); | 93 target->drawSimpleRect(rect, NULL); |
94 } | 94 } |
95 if (devClipBounds.fLeft < devPathBounds.fLeft) { | 95 if (devClipBounds.fLeft < devPathBounds.fLeft) { |
96 rect.iset(devClipBounds.fLeft, devPathBounds.fTop, | 96 rect.iset(devClipBounds.fLeft, devPathBounds.fTop, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 } | 144 } |
145 | 145 |
146 GrSWMaskHelper::DrawToTargetWithPathMask(texture, target, devPathBounds); | 146 GrSWMaskHelper::DrawToTargetWithPathMask(texture, target, devPathBounds); |
147 | 147 |
148 if (path.isInverseFillType()) { | 148 if (path.isInverseFillType()) { |
149 draw_around_inv_path(target, devClipBounds, devPathBounds); | 149 draw_around_inv_path(target, devClipBounds, devPathBounds); |
150 } | 150 } |
151 | 151 |
152 return true; | 152 return true; |
153 } | 153 } |
OLD | NEW |