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 | 8 |
9 | 9 |
10 #include "SkBitmapHeap.h" | 10 #include "SkBitmapHeap.h" |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 p->setTypeface(static_cast<SkTypeface*>(reader->readPtr())); | 700 p->setTypeface(static_cast<SkTypeface*>(reader->readPtr())); |
701 } | 701 } |
702 | 702 |
703 static void annotation_rp(SkCanvas*, SkReader32* reader, uint32_t op32, | 703 static void annotation_rp(SkCanvas*, SkReader32* reader, uint32_t op32, |
704 SkGPipeState* state) { | 704 SkGPipeState* state) { |
705 SkPaint* p = state->editPaint(); | 705 SkPaint* p = state->editPaint(); |
706 | 706 |
707 const size_t size = DrawOp_unpackData(op32); | 707 const size_t size = DrawOp_unpackData(op32); |
708 if (size > 0) { | 708 if (size > 0) { |
709 SkReadBuffer buffer(reader->skip(size), size); | 709 SkReadBuffer buffer(reader->skip(size), size); |
710 p->setAnnotation(SkNEW_ARGS(SkAnnotation, (buffer)))->unref(); | 710 p->setAnnotation(SkAnnotation::Create(buffer))->unref(); |
711 SkASSERT(buffer.offset() == size); | 711 SkASSERT(buffer.offset() == size); |
712 } else { | 712 } else { |
713 p->setAnnotation(NULL); | 713 p->setAnnotation(NULL); |
714 } | 714 } |
715 } | 715 } |
716 | 716 |
717 /////////////////////////////////////////////////////////////////////////////// | 717 /////////////////////////////////////////////////////////////////////////////// |
718 | 718 |
719 static void def_Typeface_rp(SkCanvas*, SkReader32*, uint32_t, SkGPipeState* stat
e) { | 719 static void def_Typeface_rp(SkCanvas*, SkReader32*, uint32_t, SkGPipeState* stat
e) { |
720 state->addTypeface(); | 720 state->addTypeface(); |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 status = kReadAtom_Status; | 898 status = kReadAtom_Status; |
899 break; | 899 break; |
900 } | 900 } |
901 } | 901 } |
902 | 902 |
903 if (bytesRead) { | 903 if (bytesRead) { |
904 *bytesRead = reader.offset(); | 904 *bytesRead = reader.offset(); |
905 } | 905 } |
906 return status; | 906 return status; |
907 } | 907 } |
OLD | NEW |