Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: src/pipe/SkGPipeRead.cpp

Issue 50523004: Little changes to SkAnnotation in pipe: (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/pipe/SkGPipePriv.h ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 SkGPipeState* state) { 684 SkGPipeState* state) {
685 SkASSERT(!SkToBool(state->getFlags() & SkGPipeWriter::kCrossProcess_Flag)); 685 SkASSERT(!SkToBool(state->getFlags() & SkGPipeWriter::kCrossProcess_Flag));
686 SkPaint* p = state->editPaint(); 686 SkPaint* p = state->editPaint();
687 p->setTypeface(static_cast<SkTypeface*>(reader->readPtr())); 687 p->setTypeface(static_cast<SkTypeface*>(reader->readPtr()));
688 } 688 }
689 689
690 static void annotation_rp(SkCanvas*, SkReader32* reader, uint32_t op32, 690 static void annotation_rp(SkCanvas*, SkReader32* reader, uint32_t op32,
691 SkGPipeState* state) { 691 SkGPipeState* state) {
692 SkPaint* p = state->editPaint(); 692 SkPaint* p = state->editPaint();
693 693
694 if (SkToBool(PaintOp_unpackData(op32))) { 694 const size_t size = DrawOp_unpackData(op32);
695 const size_t size = reader->readU32(); 695 if (size > 0) {
696 SkAutoMalloc storage(size); 696 SkOrderedReadBuffer buffer(reader->skip(size), size);
697
698 reader->read(storage.get(), size);
699 SkOrderedReadBuffer buffer(storage.get(), size);
700 p->setAnnotation(SkNEW_ARGS(SkAnnotation, (buffer)))->unref(); 697 p->setAnnotation(SkNEW_ARGS(SkAnnotation, (buffer)))->unref();
698 SkASSERT(buffer.offset() == size);
701 } else { 699 } else {
702 p->setAnnotation(NULL); 700 p->setAnnotation(NULL);
703 } 701 }
704 } 702 }
705 703
706 /////////////////////////////////////////////////////////////////////////////// 704 ///////////////////////////////////////////////////////////////////////////////
707 705
708 static void def_Typeface_rp(SkCanvas*, SkReader32*, uint32_t, SkGPipeState* stat e) { 706 static void def_Typeface_rp(SkCanvas*, SkReader32*, uint32_t, SkGPipeState* stat e) {
709 state->addTypeface(); 707 state->addTypeface();
710 } 708 }
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 status = kReadAtom_Status; 884 status = kReadAtom_Status;
887 break; 885 break;
888 } 886 }
889 } 887 }
890 888
891 if (bytesRead) { 889 if (bytesRead) {
892 *bytesRead = reader.offset(); 890 *bytesRead = reader.offset();
893 } 891 }
894 return status; 892 return status;
895 } 893 }
OLDNEW
« no previous file with comments | « src/pipe/SkGPipePriv.h ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698