Chromium Code Reviews| Index: src/gpu/GrDrawContext.cpp |
| diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp |
| index c4716196b9c266c8a91c99d3fef08639e34814f7..604e74822e1f850b34a5e9f48bba0f1c91697064 100644 |
| --- a/src/gpu/GrDrawContext.cpp |
| +++ b/src/gpu/GrDrawContext.cpp |
| @@ -204,35 +204,6 @@ void GrDrawContext::drawPaint(GrRenderTarget* rt, |
| } |
| } |
| -static inline bool is_irect(const SkRect& r) { |
| - return SkScalarIsInt(r.fLeft) && SkScalarIsInt(r.fTop) && |
| - SkScalarIsInt(r.fRight) && SkScalarIsInt(r.fBottom); |
| -} |
| - |
| -static bool apply_aa_to_rect(GrDrawTarget* target, |
| - GrPipelineBuilder* pipelineBuilder, |
| - SkRect* devBoundRect, |
| - const SkRect& rect, |
| - SkScalar strokeWidth, |
| - const SkMatrix& combinedMatrix, |
| - GrColor color) { |
| - if (pipelineBuilder->getRenderTarget()->isUnifiedMultisampled() || |
|
robertphillips
2015/08/13 18:33:05
So the new rect batches can handle AA rotation and
|
| - !combinedMatrix.preservesAxisAlignment()) { |
| - return false; |
| - } |
| - |
| - combinedMatrix.mapRect(devBoundRect, rect); |
| - if (!combinedMatrix.rectStaysRect()) { |
| - return true; |
| - } |
| - |
| - if (strokeWidth < 0) { |
| - return !is_irect(*devBoundRect); |
| - } |
| - |
| - return true; |
| -} |
| - |
| static inline bool rect_contains_inclusive(const SkRect& rect, const SkPoint& point) { |
| return point.fX >= rect.fLeft && point.fX <= rect.fRight && |
| point.fY >= rect.fTop && point.fY <= rect.fBottom; |
| @@ -297,13 +268,12 @@ void GrDrawContext::drawRect(GrRenderTarget* rt, |
| } |
| GrColor color = paint.getColor(); |
| - SkRect devBoundRect; |
| bool needAA = paint.isAntiAlias() && |
| !pipelineBuilder.getRenderTarget()->isUnifiedMultisampled(); |
| - bool doAA = needAA && apply_aa_to_rect(fDrawTarget, &pipelineBuilder, &devBoundRect, rect, |
| - width, viewMatrix, color); |
| - if (doAA) { |
| + if (needAA) { |
| + SkRect devBoundRect; |
| + viewMatrix.mapRect(&devBoundRect, rect); |
| SkAutoTUnref<GrBatch> batch; |
| if (width >= 0) { |
| batch.reset(GrRectBatchFactory::CreateStrokeAA(color, viewMatrix, rect, devBoundRect, |