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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 | 388 |
389 void GrDrawTarget::recordBatch(GrBatch* batch) { | 389 void GrDrawTarget::recordBatch(GrBatch* batch) { |
390 // Check if there is a Batch Draw we can batch with by linearly searching ba
ck until we either | 390 // Check if there is a Batch Draw we can batch with by linearly searching ba
ck until we either |
391 // 1) check every draw | 391 // 1) check every draw |
392 // 2) intersect with something | 392 // 2) intersect with something |
393 // 3) find a 'blocker' | 393 // 3) find a 'blocker' |
394 // Experimentally we have found that most batching occurs within the first 1
0 comparisons. | 394 // Experimentally we have found that most batching occurs within the first 1
0 comparisons. |
395 static const int kMaxLookback = 10; | 395 static const int kMaxLookback = 10; |
396 | 396 |
397 GrBATCH_INFO("Re-Recording (%s, B%u)\n" | 397 GrBATCH_INFO("Re-Recording (%s, B%u)\n" |
398 "\tBounds (%f, %f, %f, %f)\n", | 398 "\tBounds LRTB (%f, %f, %f, %f)\n", |
399 batch->name(), | 399 batch->name(), |
400 batch->uniqueID(), | 400 batch->uniqueID(), |
401 batch->bounds().fLeft, batch->bounds().fRight, | 401 batch->bounds().fLeft, batch->bounds().fRight, |
402 batch->bounds().fTop, batch->bounds().fBottom); | 402 batch->bounds().fTop, batch->bounds().fBottom); |
403 GrBATCH_INFO(SkTabString(batch->dumpInfo(), 1).c_str()); | 403 GrBATCH_INFO(SkTabString(batch->dumpInfo(), 1).c_str()); |
404 GrBATCH_INFO("\tOutcome:\n"); | 404 GrBATCH_INFO("\tOutcome:\n"); |
405 int maxCandidates = SkTMin(kMaxLookback, fBatches.count()); | 405 int maxCandidates = SkTMin(kMaxLookback, fBatches.count()); |
406 if (maxCandidates) { | 406 if (maxCandidates) { |
407 int i = 0; | 407 int i = 0; |
408 while (true) { | 408 while (true) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 } | 458 } |
459 | 459 |
460 return true; | 460 return true; |
461 } | 461 } |
462 | 462 |
463 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { | 463 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { |
464 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); | 464 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); |
465 this->recordBatch(batch); | 465 this->recordBatch(batch); |
466 batch->unref(); | 466 batch->unref(); |
467 } | 467 } |
OLD | NEW |