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 |
45 #ifdef SK_DEBUG | 47 #ifdef SK_DEBUG |
46 static int debugID = 0; | 48 static int debugID = 0; |
47 fDebugID = debugID++; | 49 fDebugID = debugID++; |
48 #endif | 50 #endif |
49 } | 51 } |
50 | 52 |
51 GrDrawTarget::~GrDrawTarget() { | 53 GrDrawTarget::~GrDrawTarget() { |
52 if (fRenderTarget && this == fRenderTarget->getLastDrawTarget()) { | 54 if (fRenderTarget && this == fRenderTarget->getLastDrawTarget()) { |
53 fRenderTarget->setLastDrawTarget(nullptr); | 55 fRenderTarget->setLastDrawTarget(nullptr); |
54 } | 56 } |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 } | 547 } |
546 | 548 |
547 return true; | 549 return true; |
548 } | 550 } |
549 | 551 |
550 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { | 552 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { |
551 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); | 553 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); |
552 this->recordBatch(batch); | 554 this->recordBatch(batch); |
553 batch->unref(); | 555 batch->unref(); |
554 } | 556 } |
OLD | NEW |