| 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 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "batches/GrDiscardBatch.h" | 25 #include "batches/GrDiscardBatch.h" |
| 26 #include "batches/GrDrawBatch.h" | 26 #include "batches/GrDrawBatch.h" |
| 27 #include "batches/GrDrawPathBatch.h" | 27 #include "batches/GrDrawPathBatch.h" |
| 28 #include "batches/GrRectBatchFactory.h" | 28 #include "batches/GrRectBatchFactory.h" |
| 29 #include "batches/GrStencilPathBatch.h" | 29 #include "batches/GrStencilPathBatch.h" |
| 30 | 30 |
| 31 #include "SkStrokeRec.h" | 31 #include "SkStrokeRec.h" |
| 32 | 32 |
| 33 //////////////////////////////////////////////////////////////////////////////// | 33 //////////////////////////////////////////////////////////////////////////////// |
| 34 | 34 |
| 35 GrDrawTarget::GrDrawTarget(GrRenderTarget* rt, GrGpu* gpu, GrResourceProvider* r
esourceProvider) | 35 GrDrawTarget::GrDrawTarget(GrRenderTarget* rt, GrGpu* gpu, GrResourceProvider* r
esourceProvider, |
| 36 const Options& options) |
| 36 : fGpu(SkRef(gpu)) | 37 : fGpu(SkRef(gpu)) |
| 37 , fResourceProvider(resourceProvider) | 38 , fResourceProvider(resourceProvider) |
| 38 , fFlushing(false) | 39 , fFlushing(false) |
| 39 , fFlags(0) | 40 , fFlags(0) |
| 40 , fRenderTarget(rt) { | 41 , fRenderTarget(rt) { |
| 41 // TODO: Stop extracting the context (currently needed by GrClipMaskManager) | 42 // TODO: Stop extracting the context (currently needed by GrClipMaskManager) |
| 42 fContext = fGpu->getContext(); | 43 fContext = fGpu->getContext(); |
| 43 fClipMaskManager.reset(new GrClipMaskManager(this)); | 44 fClipMaskManager.reset(new GrClipMaskManager(this, options.fClipBatchToBound
s)); |
| 44 | 45 |
| 45 rt->setLastDrawTarget(this); | 46 rt->setLastDrawTarget(this); |
| 46 | 47 |
| 47 #ifdef SK_DEBUG | 48 #ifdef SK_DEBUG |
| 48 static int debugID = 0; | 49 static int debugID = 0; |
| 49 fDebugID = debugID++; | 50 fDebugID = debugID++; |
| 50 #endif | 51 #endif |
| 51 } | 52 } |
| 52 | 53 |
| 53 GrDrawTarget::~GrDrawTarget() { | 54 GrDrawTarget::~GrDrawTarget() { |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 } | 550 } |
| 550 | 551 |
| 551 return true; | 552 return true; |
| 552 } | 553 } |
| 553 | 554 |
| 554 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { | 555 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { |
| 555 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); | 556 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); |
| 556 this->recordBatch(batch); | 557 this->recordBatch(batch); |
| 557 batch->unref(); | 558 batch->unref(); |
| 558 } | 559 } |
| OLD | NEW |