| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 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 "GrAtlasTextContext.h" | 9 #include "GrAtlasTextContext.h" |
| 10 #include "GrBatchTest.h" | 10 #include "GrBatchTest.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 } | 266 } |
| 267 } | 267 } |
| 268 } | 268 } |
| 269 | 269 |
| 270 GrColor color = paint.getColor(); | 270 GrColor color = paint.getColor(); |
| 271 bool needAA = paint.isAntiAlias() && | 271 bool needAA = paint.isAntiAlias() && |
| 272 !pipelineBuilder.getRenderTarget()->isUnifiedMultisampled(); | 272 !pipelineBuilder.getRenderTarget()->isUnifiedMultisampled(); |
| 273 | 273 |
| 274 // The fill path can handle rotation but not skew | 274 // The fill path can handle rotation but not skew |
| 275 // The stroke path needs the rect to remain axis aligned (no rotation or ske
w) | 275 // The stroke path needs the rect to remain axis aligned (no rotation or ske
w) |
| 276 // None of our draw rect calls can handle perspective yet | 276 // None of our AA draw rect calls can handle perspective yet |
| 277 SkASSERT(!viewMatrix.hasPerspective()); | |
| 278 bool canApplyAA = width >=0 ? viewMatrix.rectStaysRect() : viewMatrix.preser
vesRightAngles(); | 277 bool canApplyAA = width >=0 ? viewMatrix.rectStaysRect() : viewMatrix.preser
vesRightAngles(); |
| 279 | 278 |
| 280 if (needAA && canApplyAA) { | 279 if (needAA && canApplyAA) { |
| 280 SkASSERT(!viewMatrix.hasPerspective()); |
| 281 SkRect devBoundRect; | 281 SkRect devBoundRect; |
| 282 viewMatrix.mapRect(&devBoundRect, rect); | 282 viewMatrix.mapRect(&devBoundRect, rect); |
| 283 SkAutoTUnref<GrDrawBatch> batch; | 283 SkAutoTUnref<GrDrawBatch> batch; |
| 284 if (width >= 0) { | 284 if (width >= 0) { |
| 285 batch.reset(GrRectBatchFactory::CreateAAStroke(color, viewMatrix, re
ct, devBoundRect, | 285 batch.reset(GrRectBatchFactory::CreateAAStroke(color, viewMatrix, re
ct, devBoundRect, |
| 286 *strokeInfo)); | 286 *strokeInfo)); |
| 287 } else { | 287 } else { |
| 288 batch.reset(GrRectBatchFactory::CreateAAFill(color, viewMatrix, rect
, devBoundRect)); | 288 batch.reset(GrRectBatchFactory::CreateAAFill(color, viewMatrix, rect
, devBoundRect)); |
| 289 } | 289 } |
| 290 fDrawTarget->drawBatch(pipelineBuilder, batch); | 290 fDrawTarget->drawBatch(pipelineBuilder, batch); |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 RETURN_FALSE_IF_ABANDONED | 761 RETURN_FALSE_IF_ABANDONED |
| 762 | 762 |
| 763 ASSERT_OWNED_RESOURCE(rt); | 763 ASSERT_OWNED_RESOURCE(rt); |
| 764 SkASSERT(rt); | 764 SkASSERT(rt); |
| 765 return true; | 765 return true; |
| 766 } | 766 } |
| 767 | 767 |
| 768 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b
atch) { | 768 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b
atch) { |
| 769 fDrawTarget->drawBatch(*pipelineBuilder, batch); | 769 fDrawTarget->drawBatch(*pipelineBuilder, batch); |
| 770 } | 770 } |
| OLD | NEW |