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 "GrClipMaskManager.h" | 9 #include "GrClipMaskManager.h" |
10 #include "GrAAConvexPathRenderer.h" | 10 #include "GrAAConvexPathRenderer.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 drawState->setRenderTarget(target->asRenderTarget()); | 274 drawState->setRenderTarget(target->asRenderTarget()); |
275 | 275 |
276 switch (element->getType()) { | 276 switch (element->getType()) { |
277 case Element::kRect_Type: | 277 case Element::kRect_Type: |
278 // TODO: Do rects directly to the accumulator using a aa-rect GrEffe
ct that covers the | 278 // TODO: Do rects directly to the accumulator using a aa-rect GrEffe
ct that covers the |
279 // entire mask bounds and writes 0 outside the rect. | 279 // entire mask bounds and writes 0 outside the rect. |
280 if (element->isAA()) { | 280 if (element->isAA()) { |
281 getContext()->getAARectRenderer()->fillAARect(fGpu, | 281 getContext()->getAARectRenderer()->fillAARect(fGpu, |
282 fGpu, | 282 fGpu, |
283 element->getRect()
, | 283 element->getRect()
, |
| 284 SkMatrix::I(), |
| 285 element->getRect()
, |
284 false); | 286 false); |
285 } else { | 287 } else { |
286 fGpu->drawSimpleRect(element->getRect(), NULL); | 288 fGpu->drawSimpleRect(element->getRect(), NULL); |
287 } | 289 } |
288 return true; | 290 return true; |
289 case Element::kPath_Type: { | 291 case Element::kPath_Type: { |
290 SkTCopyOnFirstWrite<SkPath> path(element->getPath()); | 292 SkTCopyOnFirstWrite<SkPath> path(element->getPath()); |
291 if (path->isInverseFillType()) { | 293 if (path->isInverseFillType()) { |
292 path.writable()->toggleInverseFillType(); | 294 path.writable()->toggleInverseFillType(); |
293 } | 295 } |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 | 1001 |
1000 //////////////////////////////////////////////////////////////////////////////// | 1002 //////////////////////////////////////////////////////////////////////////////// |
1001 void GrClipMaskManager::releaseResources() { | 1003 void GrClipMaskManager::releaseResources() { |
1002 fAACache.releaseResources(); | 1004 fAACache.releaseResources(); |
1003 } | 1005 } |
1004 | 1006 |
1005 void GrClipMaskManager::setGpu(GrGpu* gpu) { | 1007 void GrClipMaskManager::setGpu(GrGpu* gpu) { |
1006 fGpu = gpu; | 1008 fGpu = gpu; |
1007 fAACache.setContext(gpu->getContext()); | 1009 fAACache.setContext(gpu->getContext()); |
1008 } | 1010 } |
OLD | NEW |