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

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

Issue 181703003: Factory methods for heap-allocated SkAnnotation objects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 months 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
« no previous file with comments | « src/core/SkPaint.cpp ('k') | no next file » | 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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « src/core/SkPaint.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698