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

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

Issue 26702002: force readbuffer clients to use specialized readFoo for flattenables (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: plumbed EffectType into readFlattenable() Created 7 years, 2 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 | Annotate | Revision Log
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 SkFlattenable* getFlat(unsigned index) const { 101 SkFlattenable* getFlat(unsigned index) const {
102 if (0 == index) { 102 if (0 == index) {
103 return NULL; 103 return NULL;
104 } 104 }
105 return fFlatArray[index - 1]; 105 return fFlatArray[index - 1];
106 } 106 }
107 107
108 void defFlattenable(PaintFlats pf, int index) { 108 void defFlattenable(PaintFlats pf, int index) {
109 index--; 109 index--;
110 SkFlattenable* obj = fReader->readFlattenable(); 110 SkFlattenable* obj = fReader->readFlattenable(kUnknown_SkEffectType);
111 if (fFlatArray.count() == index) { 111 if (fFlatArray.count() == index) {
112 *fFlatArray.append() = obj; 112 *fFlatArray.append() = obj;
113 } else { 113 } else {
114 SkSafeUnref(fFlatArray[index]); 114 SkSafeUnref(fFlatArray[index]);
115 fFlatArray[index] = obj; 115 fFlatArray[index] = obj;
116 } 116 }
117 } 117 }
118 118
119 void defFactory(const char* name) { 119 void defFactory(const char* name) {
120 SkFlattenable::Factory factory = SkFlattenable::NameToFactory(name); 120 SkFlattenable::Factory factory = SkFlattenable::NameToFactory(name);
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 status = kReadAtom_Status; 853 status = kReadAtom_Status;
854 break; 854 break;
855 } 855 }
856 } 856 }
857 857
858 if (bytesRead) { 858 if (bytesRead) {
859 *bytesRead = reader.offset(); 859 *bytesRead = reader.offset();
860 } 860 }
861 return status; 861 return status;
862 } 862 }
OLDNEW
« src/core/SkFlattenableBuffers.cpp ('K') | « src/image/SkDataPixelRef.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698