| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 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 "GrDrawTarget.h" | 9 #include "GrDrawTarget.h" |
| 10 | 10 |
| 11 #include "GrAARectRenderer.h" |
| 11 #include "GrBatch.h" | 12 #include "GrBatch.h" |
| 12 #include "GrContext.h" | 13 #include "GrContext.h" |
| 13 #include "GrDrawTargetCaps.h" | 14 #include "GrDrawTargetCaps.h" |
| 14 #include "GrPath.h" | 15 #include "GrPath.h" |
| 15 #include "GrPipeline.h" | 16 #include "GrPipeline.h" |
| 16 #include "GrMemoryPool.h" | 17 #include "GrMemoryPool.h" |
| 17 #include "GrRectBatch.h" | 18 #include "GrRectBatch.h" |
| 18 #include "GrRenderTarget.h" | 19 #include "GrRenderTarget.h" |
| 19 #include "GrRenderTargetPriv.h" | 20 #include "GrRenderTargetPriv.h" |
| 20 #include "GrSurfacePriv.h" | 21 #include "GrSurfacePriv.h" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // support NV_blend_equation_advanced. | 286 // support NV_blend_equation_advanced. |
| 286 GrDrawTarget::PipelineInfo pipelineInfo(pipelineBuilder, &scissorState, path
Proc, NULL, this); | 287 GrDrawTarget::PipelineInfo pipelineInfo(pipelineBuilder, &scissorState, path
Proc, NULL, this); |
| 287 if (pipelineInfo.mustSkipDraw()) { | 288 if (pipelineInfo.mustSkipDraw()) { |
| 288 return; | 289 return; |
| 289 } | 290 } |
| 290 | 291 |
| 291 this->onDrawPaths(pathProc, pathRange, indices, indexType, transformValues, | 292 this->onDrawPaths(pathProc, pathRange, indices, indexType, transformValues, |
| 292 transformType, count, stencilSettings, pipelineInfo); | 293 transformType, count, stencilSettings, pipelineInfo); |
| 293 } | 294 } |
| 294 | 295 |
| 295 void GrDrawTarget::drawRect(GrPipelineBuilder* pipelineBuilder, | 296 void GrDrawTarget::drawBWRect(GrPipelineBuilder* pipelineBuilder, |
| 296 GrColor color, | 297 GrColor color, |
| 297 const SkMatrix& viewMatrix, | 298 const SkMatrix& viewMatrix, |
| 298 const SkRect& rect, | 299 const SkRect& rect, |
| 299 const SkRect* localRect, | 300 const SkRect* localRect, |
| 300 const SkMatrix* localMatrix) { | 301 const SkMatrix* localMatrix) { |
| 301 SkAutoTUnref<GrBatch> batch(GrRectBatch::Create(color, viewMatrix, rect, loca
lRect, | 302 SkAutoTUnref<GrBatch> batch(GrRectBatch::Create(color, viewMatrix, rect, loca
lRect, |
| 302 localMatrix)); | 303 localMatrix)); |
| 303 this->drawBatch(pipelineBuilder, batch); | 304 this->drawBatch(pipelineBuilder, batch); |
| 304 } | 305 } |
| 305 | 306 |
| 307 void GrDrawTarget::drawAARect(GrPipelineBuilder* pipelineBuilder, |
| 308 GrColor color, |
| 309 const SkMatrix& viewMatrix, |
| 310 const SkRect& rect, |
| 311 const SkRect& devRect) { |
| 312 GrAARectRenderer::FillAARect(this, pipelineBuilder, color, viewMatrix, rect,
devRect); |
| 313 } |
| 314 |
| 306 void GrDrawTarget::clear(const SkIRect* rect, | 315 void GrDrawTarget::clear(const SkIRect* rect, |
| 307 GrColor color, | 316 GrColor color, |
| 308 bool canIgnoreRect, | 317 bool canIgnoreRect, |
| 309 GrRenderTarget* renderTarget) { | 318 GrRenderTarget* renderTarget) { |
| 310 if (fCaps->useDrawInsteadOfClear()) { | 319 if (fCaps->useDrawInsteadOfClear()) { |
| 311 // This works around a driver bug with clear by drawing a rect instead. | 320 // This works around a driver bug with clear by drawing a rect instead. |
| 312 // The driver will ignore a clear if it is the only thing rendered to a | 321 // The driver will ignore a clear if it is the only thing rendered to a |
| 313 // target before the target is read. | 322 // target before the target is read. |
| 314 SkIRect rtRect = SkIRect::MakeWH(renderTarget->width(), renderTarget->he
ight()); | 323 SkIRect rtRect = SkIRect::MakeWH(renderTarget->width(), renderTarget->he
ight()); |
| 315 if (NULL == rect || canIgnoreRect || rect->contains(rtRect)) { | 324 if (NULL == rect || canIgnoreRect || rect->contains(rtRect)) { |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, | 792 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, |
| 784 GrPipelineBuilder::AutoRestoreStencil* ars, | 793 GrPipelineBuilder::AutoRestoreStencil* ars, |
| 785 GrScissorState* scissorState, | 794 GrScissorState* scissorState, |
| 786 const SkRect* devBounds) { | 795 const SkRect* devBounds) { |
| 787 return fClipMaskManager.setupClipping(pipelineBuilder, | 796 return fClipMaskManager.setupClipping(pipelineBuilder, |
| 788 arfp, | 797 arfp, |
| 789 ars, | 798 ars, |
| 790 scissorState, | 799 scissorState, |
| 791 devBounds); | 800 devBounds); |
| 792 } | 801 } |
| OLD | NEW |