| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 } | 44 } |
| 45 | 45 |
| 46 void ReplayingCanvas::updateInRange() | 46 void ReplayingCanvas::updateInRange() |
| 47 { | 47 { |
| 48 if (m_abortDrawing) | 48 if (m_abortDrawing) |
| 49 return; | 49 return; |
| 50 unsigned step = callCount() + 1; | 50 unsigned step = callCount() + 1; |
| 51 if (m_toStep && step > m_toStep) | 51 if (m_toStep && step > m_toStep) |
| 52 m_abortDrawing = true; | 52 m_abortDrawing = true; |
| 53 if (step == m_fromStep) | 53 if (step == m_fromStep) |
| 54 this->SkCanvas::clear(SkColorSetARGB(255, 255, 255, 255)); // FIXME: fil
l with nine patch instead. | 54 this->SkCanvas::clear(SK_ColorTRANSPARENT); |
| 55 } | 55 } |
| 56 | 56 |
| 57 bool ReplayingCanvas::abort() | 57 bool ReplayingCanvas::abort() |
| 58 { | 58 { |
| 59 return m_abortDrawing; | 59 return m_abortDrawing; |
| 60 } | 60 } |
| 61 | 61 |
| 62 SkCanvas::SaveLayerStrategy ReplayingCanvas::getSaveLayerStrategy(const SaveLaye
rRec& rec) | 62 SkCanvas::SaveLayerStrategy ReplayingCanvas::getSaveLayerStrategy(const SaveLaye
rRec& rec) |
| 63 { | 63 { |
| 64 // We're about to create a layer and we have not cleared the device yet. | 64 // We're about to create a layer and we have not cleared the device yet. |
| 65 // Let's clear now, so it has effect on all layers. | 65 // Let's clear now, so it has effect on all layers. |
| 66 if (callCount() <= m_fromStep) | 66 if (callCount() <= m_fromStep) |
| 67 this->SkCanvas::clear(SkColorSetARGB(255, 255, 255, 255)); // FIXME: fil
l with nine patch instead. | 67 this->SkCanvas::clear(SK_ColorTRANSPARENT); |
| 68 | 68 |
| 69 return this->InterceptingCanvas<ReplayingCanvas>::getSaveLayerStrategy(rec); | 69 return this->InterceptingCanvas<ReplayingCanvas>::getSaveLayerStrategy(rec); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void ReplayingCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* ma
trix, const SkPaint* paint) | 72 void ReplayingCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* ma
trix, const SkPaint* paint) |
| 73 { | 73 { |
| 74 this->unrollDrawPicture(picture, matrix, paint, this); | 74 this->unrollDrawPicture(picture, matrix, paint, this); |
| 75 } | 75 } |
| 76 | 76 |
| 77 } // namespace blink | 77 } // namespace blink |
| OLD | NEW |