| 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 24 matching lines...) Expand all Loading... |
| 35 GrDrawTarget::GrDrawTarget(GrRenderTarget* rt, GrGpu* gpu, GrResourceProvider* r
esourceProvider) | 35 GrDrawTarget::GrDrawTarget(GrRenderTarget* rt, GrGpu* gpu, GrResourceProvider* r
esourceProvider) |
| 36 : fGpu(SkRef(gpu)) | 36 : fGpu(SkRef(gpu)) |
| 37 , fResourceProvider(resourceProvider) | 37 , fResourceProvider(resourceProvider) |
| 38 , fFlushing(false) | 38 , fFlushing(false) |
| 39 , fFlags(0) | 39 , fFlags(0) |
| 40 , fRenderTarget(rt) { | 40 , fRenderTarget(rt) { |
| 41 // TODO: Stop extracting the context (currently needed by GrClipMaskManager) | 41 // TODO: Stop extracting the context (currently needed by GrClipMaskManager) |
| 42 fContext = fGpu->getContext(); | 42 fContext = fGpu->getContext(); |
| 43 fClipMaskManager.reset(new GrClipMaskManager(this)); | 43 fClipMaskManager.reset(new GrClipMaskManager(this)); |
| 44 | 44 |
| 45 rt->setLastDrawTarget(this); | |
| 46 | |
| 47 #ifdef SK_DEBUG | 45 #ifdef SK_DEBUG |
| 48 static int debugID = 0; | 46 static int debugID = 0; |
| 49 fDebugID = debugID++; | 47 fDebugID = debugID++; |
| 50 #endif | 48 #endif |
| 51 } | 49 } |
| 52 | 50 |
| 53 GrDrawTarget::~GrDrawTarget() { | 51 GrDrawTarget::~GrDrawTarget() { |
| 54 if (fRenderTarget && this == fRenderTarget->getLastDrawTarget()) { | 52 if (fRenderTarget && this == fRenderTarget->getLastDrawTarget()) { |
| 55 fRenderTarget->setLastDrawTarget(nullptr); | 53 fRenderTarget->setLastDrawTarget(nullptr); |
| 56 } | 54 } |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 } | 545 } |
| 548 | 546 |
| 549 return true; | 547 return true; |
| 550 } | 548 } |
| 551 | 549 |
| 552 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { | 550 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { |
| 553 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); | 551 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); |
| 554 this->recordBatch(batch); | 552 this->recordBatch(batch); |
| 555 batch->unref(); | 553 batch->unref(); |
| 556 } | 554 } |
| OLD | NEW |