| 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 "SkNWayCanvas.h" | 8 #include "SkNWayCanvas.h" |
| 9 | 9 |
| 10 SkNWayCanvas::SkNWayCanvas(int width, int height) | 10 SkNWayCanvas::SkNWayCanvas(int width, int height) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 return false; | 50 return false; |
| 51 } | 51 } |
| 52 SkCanvas* operator->() { return fCanvas; } | 52 SkCanvas* operator->() { return fCanvas; } |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 const SkTDArray<SkCanvas*>& fList; | 55 const SkTDArray<SkCanvas*>& fList; |
| 56 int fIndex; | 56 int fIndex; |
| 57 SkCanvas* fCanvas; | 57 SkCanvas* fCanvas; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 void SkNWayCanvas::onSave(SaveFlags flags) { | 60 int SkNWayCanvas::save(SaveFlags flags) { |
| 61 Iter iter(fList); | 61 Iter iter(fList); |
| 62 while (iter.next()) { | 62 while (iter.next()) { |
| 63 iter->save(flags); | 63 iter->save(flags); |
| 64 } | 64 } |
| 65 | 65 return this->INHERITED::save(flags); |
| 66 this->INHERITED::onSave(flags); | |
| 67 } | 66 } |
| 68 | 67 |
| 69 bool SkNWayCanvas::onSaveLayer(const SkRect* bounds, const SkPaint* paint, | 68 int SkNWayCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint, |
| 70 SaveFlags flags) { | 69 SaveFlags flags) { |
| 71 Iter iter(fList); | 70 Iter iter(fList); |
| 72 while (iter.next()) { | 71 while (iter.next()) { |
| 73 iter->saveLayer(bounds, paint, flags); | 72 iter->saveLayer(bounds, paint, flags); |
| 74 } | 73 } |
| 75 | 74 return this->INHERITED::saveLayer(bounds, paint, flags); |
| 76 this->INHERITED::onSaveLayer(bounds, paint, flags); | |
| 77 // No need for a layer. | |
| 78 return false; | |
| 79 } | 75 } |
| 80 | 76 |
| 81 void SkNWayCanvas::onRestore() { | 77 void SkNWayCanvas::restore() { |
| 82 Iter iter(fList); | 78 Iter iter(fList); |
| 83 while (iter.next()) { | 79 while (iter.next()) { |
| 84 iter->restore(); | 80 iter->restore(); |
| 85 } | 81 } |
| 86 this->INHERITED::onRestore(); | 82 this->INHERITED::restore(); |
| 87 } | 83 } |
| 88 | 84 |
| 89 bool SkNWayCanvas::translate(SkScalar dx, SkScalar dy) { | 85 bool SkNWayCanvas::translate(SkScalar dx, SkScalar dy) { |
| 90 Iter iter(fList); | 86 Iter iter(fList); |
| 91 while (iter.next()) { | 87 while (iter.next()) { |
| 92 iter->translate(dx, dy); | 88 iter->translate(dx, dy); |
| 93 } | 89 } |
| 94 return this->INHERITED::translate(dx, dy); | 90 return this->INHERITED::translate(dx, dy); |
| 95 } | 91 } |
| 96 | 92 |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 iter->addComment(kywd, value); | 350 iter->addComment(kywd, value); |
| 355 } | 351 } |
| 356 } | 352 } |
| 357 | 353 |
| 358 void SkNWayCanvas::endCommentGroup() { | 354 void SkNWayCanvas::endCommentGroup() { |
| 359 Iter iter(fList); | 355 Iter iter(fList); |
| 360 while (iter.next()) { | 356 while (iter.next()) { |
| 361 iter->endCommentGroup(); | 357 iter->endCommentGroup(); |
| 362 } | 358 } |
| 363 } | 359 } |
| OLD | NEW |