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 "GrCaps.h" | 13 #include "GrCaps.h" |
13 #include "GrContext.h" | 14 #include "GrContext.h" |
14 #include "GrContextOptions.h" | 15 #include "GrContextOptions.h" |
15 #include "GrPath.h" | 16 #include "GrPath.h" |
16 #include "GrPipeline.h" | 17 #include "GrPipeline.h" |
17 #include "GrMemoryPool.h" | 18 #include "GrMemoryPool.h" |
18 #include "GrRectBatch.h" | 19 #include "GrRectBatch.h" |
19 #include "GrRenderTarget.h" | 20 #include "GrRenderTarget.h" |
20 #include "GrRenderTargetPriv.h" | 21 #include "GrRenderTargetPriv.h" |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 // support NV_blend_equation_advanced. | 287 // support NV_blend_equation_advanced. |
287 GrDrawTarget::PipelineInfo pipelineInfo(pipelineBuilder, &scissorState, path
Proc, NULL, this); | 288 GrDrawTarget::PipelineInfo pipelineInfo(pipelineBuilder, &scissorState, path
Proc, NULL, this); |
288 if (pipelineInfo.mustSkipDraw()) { | 289 if (pipelineInfo.mustSkipDraw()) { |
289 return; | 290 return; |
290 } | 291 } |
291 | 292 |
292 this->onDrawPaths(pathProc, pathRange, indices, indexType, transformValues, | 293 this->onDrawPaths(pathProc, pathRange, indices, indexType, transformValues, |
293 transformType, count, stencilSettings, pipelineInfo); | 294 transformType, count, stencilSettings, pipelineInfo); |
294 } | 295 } |
295 | 296 |
296 void GrDrawTarget::drawRect(GrPipelineBuilder* pipelineBuilder, | 297 void GrDrawTarget::drawBWRect(GrPipelineBuilder* pipelineBuilder, |
297 GrColor color, | 298 GrColor color, |
298 const SkMatrix& viewMatrix, | 299 const SkMatrix& viewMatrix, |
299 const SkRect& rect, | 300 const SkRect& rect, |
300 const SkRect* localRect, | 301 const SkRect* localRect, |
301 const SkMatrix* localMatrix) { | 302 const SkMatrix* localMatrix) { |
302 SkAutoTUnref<GrBatch> batch(GrRectBatch::Create(color, viewMatrix, rect, loca
lRect, | 303 SkAutoTUnref<GrBatch> batch(GrRectBatch::Create(color, viewMatrix, rect, loca
lRect, |
303 localMatrix)); | 304 localMatrix)); |
304 this->drawBatch(pipelineBuilder, batch); | 305 this->drawBatch(pipelineBuilder, batch); |
305 } | 306 } |
306 | 307 |
| 308 void GrDrawTarget::drawAARect(GrPipelineBuilder* pipelineBuilder, |
| 309 GrColor color, |
| 310 const SkMatrix& viewMatrix, |
| 311 const SkRect& rect, |
| 312 const SkRect& devRect) { |
| 313 GrAARectRenderer::FillAARect(this, pipelineBuilder, color, viewMatrix, rect,
devRect); |
| 314 } |
| 315 |
307 void GrDrawTarget::clear(const SkIRect* rect, | 316 void GrDrawTarget::clear(const SkIRect* rect, |
308 GrColor color, | 317 GrColor color, |
309 bool canIgnoreRect, | 318 bool canIgnoreRect, |
310 GrRenderTarget* renderTarget) { | 319 GrRenderTarget* renderTarget) { |
311 if (fCaps->useDrawInsteadOfClear()) { | 320 if (fCaps->useDrawInsteadOfClear()) { |
312 // This works around a driver bug with clear by drawing a rect instead. | 321 // This works around a driver bug with clear by drawing a rect instead. |
313 // The driver will ignore a clear if it is the only thing rendered to a | 322 // The driver will ignore a clear if it is the only thing rendered to a |
314 // target before the target is read. | 323 // target before the target is read. |
315 SkIRect rtRect = SkIRect::MakeWH(renderTarget->width(), renderTarget->he
ight()); | 324 SkIRect rtRect = SkIRect::MakeWH(renderTarget->width(), renderTarget->he
ight()); |
316 if (NULL == rect || canIgnoreRect || rect->contains(rtRect)) { | 325 if (NULL == rect || canIgnoreRect || rect->contains(rtRect)) { |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, | 751 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, |
743 GrPipelineBuilder::AutoRestoreStencil* ars, | 752 GrPipelineBuilder::AutoRestoreStencil* ars, |
744 GrScissorState* scissorState, | 753 GrScissorState* scissorState, |
745 const SkRect* devBounds) { | 754 const SkRect* devBounds) { |
746 return fClipMaskManager.setupClipping(pipelineBuilder, | 755 return fClipMaskManager.setupClipping(pipelineBuilder, |
747 arfp, | 756 arfp, |
748 ars, | 757 ars, |
749 scissorState, | 758 scissorState, |
750 devBounds); | 759 devBounds); |
751 } | 760 } |
OLD | NEW |