| 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 "GrAARectRenderer.h" |
| 12 #include "GrCaps.h" | 12 #include "GrCaps.h" |
| 13 #include "GrGpu.h" | 13 #include "GrGpu.h" |
| 14 #include "GrPath.h" | 14 #include "GrPath.h" |
| 15 #include "GrPipeline.h" | 15 #include "GrPipeline.h" |
| 16 #include "GrMemoryPool.h" | 16 #include "GrMemoryPool.h" |
| 17 #include "GrRenderTarget.h" | 17 #include "GrRenderTarget.h" |
| 18 #include "GrResourceProvider.h" | 18 #include "GrResourceProvider.h" |
| 19 #include "GrRenderTargetPriv.h" | 19 #include "GrRenderTargetPriv.h" |
| 20 #include "GrSurfacePriv.h" | 20 #include "GrSurfacePriv.h" |
| 21 #include "GrTexture.h" | 21 #include "GrTexture.h" |
| 22 #include "GrVertexBuffer.h" | 22 #include "GrVertexBuffer.h" |
| 23 | 23 |
| 24 #include "batches/GrBatch.h" | 24 #include "batches/GrBatch.h" |
| 25 #include "batches/GrRectBatch.h" | 25 #include "batches/GrRectBatchFactory.h" |
| 26 | 26 |
| 27 #include "SkStrokeRec.h" | 27 #include "SkStrokeRec.h" |
| 28 | 28 |
| 29 //////////////////////////////////////////////////////////////////////////////// | 29 //////////////////////////////////////////////////////////////////////////////// |
| 30 | 30 |
| 31 GrDrawTarget::GrDrawTarget(GrGpu* gpu, GrResourceProvider* resourceProvider) | 31 GrDrawTarget::GrDrawTarget(GrGpu* gpu, GrResourceProvider* resourceProvider) |
| 32 : fGpu(SkRef(gpu)) | 32 : fGpu(SkRef(gpu)) |
| 33 , fCaps(SkRef(gpu->caps())) | 33 , fCaps(SkRef(gpu->caps())) |
| 34 , fResourceProvider(resourceProvider) | 34 , fResourceProvider(resourceProvider) |
| 35 , fGpuTraceMarkerCount(0) | 35 , fGpuTraceMarkerCount(0) |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 this->onDrawPaths(pathProc, pathRange, indices, indexType, transformValues, | 287 this->onDrawPaths(pathProc, pathRange, indices, indexType, transformValues, |
| 288 transformType, count, stencilSettings, pipelineInfo); | 288 transformType, count, stencilSettings, pipelineInfo); |
| 289 } | 289 } |
| 290 | 290 |
| 291 void GrDrawTarget::drawBWRect(const GrPipelineBuilder& pipelineBuilder, | 291 void GrDrawTarget::drawBWRect(const GrPipelineBuilder& pipelineBuilder, |
| 292 GrColor color, | 292 GrColor color, |
| 293 const SkMatrix& viewMatrix, | 293 const SkMatrix& viewMatrix, |
| 294 const SkRect& rect, | 294 const SkRect& rect, |
| 295 const SkRect* localRect, | 295 const SkRect* localRect, |
| 296 const SkMatrix* localMatrix) { | 296 const SkMatrix* localMatrix) { |
| 297 SkAutoTUnref<GrBatch> batch(GrRectBatch::Create(color, viewMatrix, rect, loca
lRect, | 297 SkAutoTUnref<GrBatch> batch(GrRectBatchFactory::Create(color, viewMatrix, rec
t, localRect, |
| 298 localMatrix)); | 298 localMatrix)); |
| 299 this->drawBatch(pipelineBuilder, batch); | 299 this->drawBatch(pipelineBuilder, batch); |
| 300 } | 300 } |
| 301 | 301 |
| 302 void GrDrawTarget::drawAARect(const GrPipelineBuilder& pipelineBuilder, | 302 void GrDrawTarget::drawAARect(const GrPipelineBuilder& pipelineBuilder, |
| 303 GrColor color, | 303 GrColor color, |
| 304 const SkMatrix& viewMatrix, | 304 const SkMatrix& viewMatrix, |
| 305 const SkRect& rect, | 305 const SkRect& rect, |
| 306 const SkRect& devRect) { | 306 const SkRect& devRect) { |
| 307 GrAARectRenderer::FillAARect(this, pipelineBuilder, color, viewMatrix, rect,
devRect); | 307 GrAARectRenderer::FillAARect(this, pipelineBuilder, color, viewMatrix, rect,
devRect); |
| 308 } | 308 } |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 ars, | 517 ars, |
| 518 scissorState, | 518 scissorState, |
| 519 devBounds); | 519 devBounds); |
| 520 } | 520 } |
| 521 | 521 |
| 522 void GrClipTarget::purgeResources() { | 522 void GrClipTarget::purgeResources() { |
| 523 // The clip mask manager can rebuild all its clip masks so just | 523 // The clip mask manager can rebuild all its clip masks so just |
| 524 // get rid of them all. | 524 // get rid of them all. |
| 525 fClipMaskManager->purgeResources(); | 525 fClipMaskManager->purgeResources(); |
| 526 }; | 526 }; |
| OLD | NEW |