Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 #include "SkPictureRecord.h" | 8 #include "SkPictureRecord.h" |
| 9 #include "SkTSearch.h" | 9 #include "SkTSearch.h" |
| 10 #include "SkPixelRef.h" | 10 #include "SkPixelRef.h" |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 471 } | 471 } |
| 472 | 472 |
| 473 // now offset points to a save | 473 // now offset points to a save |
| 474 offset = -offset; | 474 offset = -offset; |
| 475 uint32_t opSize; | 475 uint32_t opSize; |
| 476 DrawType op = peek_op_and_size(writer, offset, &opSize); | 476 DrawType op = peek_op_and_size(writer, offset, &opSize); |
| 477 if (SAVE_LAYER == op) { | 477 if (SAVE_LAYER == op) { |
| 478 // not ready to cull these out yet (mrr) | 478 // not ready to cull these out yet (mrr) |
| 479 return false; | 479 return false; |
| 480 } | 480 } |
| 481 SkASSERT(SAVE == op); | 481 SkASSERT(SAVE == op); |
|
robertphillips
2013/08/13 12:12:32
Add a kSaveSize near the kSaveLayerNoBoundsSize gl
| |
| 482 SkASSERT(8 == opSize); | |
| 483 | |
| 484 // get the save flag (last 4-bytes of the space allocated for the opSize) | |
| 485 SkCanvas::SaveFlags saveFlag = (SkCanvas::SaveFlags) *writer->peek32(offset+ 4); | |
|
robertphillips
2013/08/13 12:12:32
Is the evil combo we see everywhere a MatrixClip s
djsollen
2013/08/13 13:24:45
Chrome doesn't do selective save and restores like
| |
| 486 if (SkCanvas::kMatrixClip_SaveFlag != (SkCanvas::kMatrixClip_SaveFlag & save Flag)) { | |
|
robertphillips
2013/08/13 12:12:32
// The following code is only correct for kMatrixC
| |
| 487 return false; | |
| 488 } | |
| 482 | 489 |
| 483 // Walk forward until we get back to either a draw-verb (abort) or we hit | 490 // Walk forward until we get back to either a draw-verb (abort) or we hit |
| 484 // our restore (success). | 491 // our restore (success). |
| 485 int32_t saveOffset = offset; | 492 int32_t saveOffset = offset; |
| 486 | 493 |
| 487 offset += opSize; | 494 offset += opSize; |
| 488 while (offset < restoreOffset) { | 495 while (offset < restoreOffset) { |
| 489 op = peek_op_and_size(writer, offset, &opSize); | 496 op = peek_op_and_size(writer, offset, &opSize); |
| 490 if ((op > CONCAT && op < ROTATE) || (SAVE_LAYER == op)) { | 497 if ((op > CONCAT && op < ROTATE) || (SAVE_LAYER == op)) { |
| 491 // drawing verb, abort | 498 // drawing verb, abort |
| (...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1472 void SkPictureRecord::validateRegions() const { | 1479 void SkPictureRecord::validateRegions() const { |
| 1473 int count = fRegions.count(); | 1480 int count = fRegions.count(); |
| 1474 SkASSERT((unsigned) count < 0x1000); | 1481 SkASSERT((unsigned) count < 0x1000); |
| 1475 for (int index = 0; index < count; index++) { | 1482 for (int index = 0; index < count; index++) { |
| 1476 const SkFlatData* region = fRegions[index]; | 1483 const SkFlatData* region = fRegions[index]; |
| 1477 SkASSERT(region); | 1484 SkASSERT(region); |
| 1478 // region->validate(); | 1485 // region->validate(); |
| 1479 } | 1486 } |
| 1480 } | 1487 } |
| 1481 #endif | 1488 #endif |
| OLD | NEW |