| Index: src/gpu/GrDrawContext.cpp
|
| diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
|
| index 9c07211754a885f80e73b4b874e0dcd7cacb4b0f..8b72a1bb1aef2fd87575c762c04a0de7182ef020 100644
|
| --- a/src/gpu/GrDrawContext.cpp
|
| +++ b/src/gpu/GrDrawContext.cpp
|
| @@ -23,6 +23,7 @@
|
| #include "batches/GrDrawAtlasBatch.h"
|
| #include "batches/GrDrawVerticesBatch.h"
|
| #include "batches/GrRectBatchFactory.h"
|
| +#include "batches/GrNinePatch.h" // TODO Factory
|
|
|
| #define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == fDrawingManager->getContext())
|
| #define RETURN_IF_ABANDONED if (fDrawingManager->abandoned()) { return; }
|
| @@ -569,6 +570,27 @@ void GrDrawContext::drawOval(const GrClip& clip,
|
| }
|
| }
|
|
|
| +void GrDrawContext::drawImageNine(const GrClip& clip,
|
| + const GrPaint& paint,
|
| + const SkMatrix& viewMatrix,
|
| + int imageWidth,
|
| + int imageHeight,
|
| + const SkIRect& center,
|
| + const SkRect& dst) {
|
| + RETURN_IF_ABANDONED
|
| + SkDEBUGCODE(this->validate();)
|
| +
|
| + AutoCheckFlush acf(fDrawingManager);
|
| +
|
| + SkAutoTUnref<GrDrawBatch> batch(GrNinePatch::CreateNonAA(paint.getColor(), viewMatrix,
|
| + imageWidth, imageHeight,
|
| + center, dst));
|
| +
|
| + GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip);
|
| + this->getDrawTarget()->drawBatch(pipelineBuilder, batch);
|
| +}
|
| +
|
| +
|
| // Can 'path' be drawn as a pair of filled nested rectangles?
|
| static bool is_nested_rects(const SkMatrix& viewMatrix,
|
| const SkPath& path,
|
|
|