OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrRenderTargetOpList.h" | 8 #include "GrRenderTargetOpList.h" |
9 | 9 |
10 #include "GrAppliedClip.h" | 10 #include "GrAppliedClip.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // Experimentally we have found that most batching occurs within the first 10 co
mparisons. | 45 // Experimentally we have found that most batching occurs within the first 10 co
mparisons. |
46 static const int kDefaultMaxBatchLookback = 10; | 46 static const int kDefaultMaxBatchLookback = 10; |
47 static const int kDefaultMaxBatchLookahead = 10; | 47 static const int kDefaultMaxBatchLookahead = 10; |
48 | 48 |
49 GrRenderTargetOpList::GrRenderTargetOpList(GrRenderTargetProxy* rtp, GrGpu* gpu, | 49 GrRenderTargetOpList::GrRenderTargetOpList(GrRenderTargetProxy* rtp, GrGpu* gpu, |
50 GrResourceProvider* resourceProvider, | 50 GrResourceProvider* resourceProvider, |
51 GrAuditTrail* auditTrail, const Optio
ns& options) | 51 GrAuditTrail* auditTrail, const Optio
ns& options) |
52 : INHERITED(rtp, auditTrail) | 52 : INHERITED(rtp, auditTrail) |
53 , fLastFullClearBatch(nullptr) | 53 , fLastFullClearBatch(nullptr) |
54 , fGpu(SkRef(gpu)) | 54 , fGpu(SkRef(gpu)) |
55 , fResourceProvider(resourceProvider) { | 55 , fResourceProvider(resourceProvider) |
| 56 , fLastClipStackGenID(SK_InvalidUniqueID) { |
56 // TODO: Stop extracting the context (currently needed by GrClip) | 57 // TODO: Stop extracting the context (currently needed by GrClip) |
57 fContext = fGpu->getContext(); | 58 fContext = fGpu->getContext(); |
58 | 59 |
59 fClipBatchToBounds = options.fClipBatchToBounds; | 60 fClipBatchToBounds = options.fClipBatchToBounds; |
60 fDrawBatchBounds = options.fDrawBatchBounds; | 61 fDrawBatchBounds = options.fDrawBatchBounds; |
61 fMaxBatchLookback = (options.fMaxBatchLookback < 0) ? kDefaultMaxBatchLookba
ck : | 62 fMaxBatchLookback = (options.fMaxBatchLookback < 0) ? kDefaultMaxBatchLookba
ck : |
62 options.fMaxBatchLookb
ack; | 63 options.fMaxBatchLookb
ack; |
63 fMaxBatchLookahead = (options.fMaxBatchLookahead < 0) ? kDefaultMaxBatchLook
ahead : | 64 fMaxBatchLookahead = (options.fMaxBatchLookahead < 0) ? kDefaultMaxBatchLook
ahead : |
64 options.fMaxBatchLook
ahead; | 65 options.fMaxBatchLook
ahead; |
65 | 66 |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 | 572 |
572 /////////////////////////////////////////////////////////////////////////////// | 573 /////////////////////////////////////////////////////////////////////////////// |
573 | 574 |
574 void GrRenderTargetOpList::clearStencilClip(const GrFixedClip& clip, | 575 void GrRenderTargetOpList::clearStencilClip(const GrFixedClip& clip, |
575 bool insideStencilMask, | 576 bool insideStencilMask, |
576 GrRenderTarget* rt) { | 577 GrRenderTarget* rt) { |
577 GrBatch* batch = new GrClearStencilClipBatch(clip, insideStencilMask, rt); | 578 GrBatch* batch = new GrClearStencilClipBatch(clip, insideStencilMask, rt); |
578 this->recordBatch(batch, batch->bounds()); | 579 this->recordBatch(batch, batch->bounds()); |
579 batch->unref(); | 580 batch->unref(); |
580 } | 581 } |
OLD | NEW |