| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include <new> | 7 #include <new> |
| 8 #include "SkPictureData.h" | 8 #include "SkPictureData.h" |
| 9 #include "SkPictureRecord.h" | 9 #include "SkPictureRecord.h" |
| 10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 return false; | 534 return false; |
| 535 } | 535 } |
| 536 SkASSERT(NULL == fOpData); | 536 SkASSERT(NULL == fOpData); |
| 537 fOpData = data.detach(); | 537 fOpData = data.detach(); |
| 538 } break; | 538 } break; |
| 539 case SK_PICT_PICTURE_TAG: | 539 case SK_PICT_PICTURE_TAG: |
| 540 if (!new_array_from_buffer(buffer, size, &fPictureRefs, &fPictureCou
nt, | 540 if (!new_array_from_buffer(buffer, size, &fPictureRefs, &fPictureCou
nt, |
| 541 create_picture_from_buffer)) { | 541 create_picture_from_buffer)) { |
| 542 return false; | 542 return false; |
| 543 } | 543 } |
| 544 break; |
| 544 default: | 545 default: |
| 545 // The tag was invalid. | 546 // The tag was invalid. |
| 546 return false; | 547 return false; |
| 547 } | 548 } |
| 548 return true; // success | 549 return true; // success |
| 549 } | 550 } |
| 550 | 551 |
| 551 SkPictureData* SkPictureData::CreateFromStream(SkStream* stream, | 552 SkPictureData* SkPictureData::CreateFromStream(SkStream* stream, |
| 552 const SkPictInfo& info, | 553 const SkPictInfo& info, |
| 553 SkPicture::InstallPixelRefProc pr
oc) { | 554 SkPicture::InstallPixelRefProc pr
oc) { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 } | 622 } |
| 622 } | 623 } |
| 623 | 624 |
| 624 bool SkPictureData::suitableForLayerOptimization() const { | 625 bool SkPictureData::suitableForLayerOptimization() const { |
| 625 return fContentInfo.numLayers() > 0; | 626 return fContentInfo.numLayers() > 0; |
| 626 } | 627 } |
| 627 #endif | 628 #endif |
| 628 /////////////////////////////////////////////////////////////////////////////// | 629 /////////////////////////////////////////////////////////////////////////////// |
| 629 | 630 |
| 630 | 631 |
| OLD | NEW |