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

Side by Side Diff: src/core/SkFlattenable.cpp

Issue 395603002: Simplify flattening to just write enough to call the factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 4 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/SkFilterShader.cpp ('k') | src/core/SkImageFilter.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
2 /* 1 /*
3 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
4 * 3 *
5 * 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
6 * found in the LICENSE file. 5 * found in the LICENSE file.
7 */ 6 */
7
8 #include "SkFlattenable.h" 8 #include "SkFlattenable.h"
9 #include "SkPtrRecorder.h" 9 #include "SkPtrRecorder.h"
10 #include "SkReadBuffer.h"
10 11
11 /////////////////////////////////////////////////////////////////////////////// 12 ///////////////////////////////////////////////////////////////////////////////
12 13
13 void SkFlattenable::flatten(SkWriteBuffer&) const 14 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
14 { 15 bool SkFlattenable::NeedsDeepUnflatten(const SkReadBuffer& buffer) {
15 /* we don't write anything at the moment, but this allows our subclasses 16 return buffer.isVersionLT(SkReadBuffer::kFlattenCreateProc_Version);
16 to not know that, since we want them to always call INHERITED::flatten()
17 in their code.
18 */
19 } 17 }
18 #endif
20 19
21 /////////////////////////////////////////////////////////////////////////////// 20 ///////////////////////////////////////////////////////////////////////////////
22 21
23 SkNamedFactorySet::SkNamedFactorySet() : fNextAddedFactory(0) {} 22 SkNamedFactorySet::SkNamedFactorySet() : fNextAddedFactory(0) {}
24 23
25 uint32_t SkNamedFactorySet::find(SkFlattenable::Factory factory) { 24 uint32_t SkNamedFactorySet::find(SkFlattenable::Factory factory) {
26 uint32_t index = fFactorySet.find(factory); 25 uint32_t index = fFactorySet.find(factory);
27 if (index > 0) { 26 if (index > 0) {
28 return index; 27 return index;
29 } 28 }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 report_no_entries(__FUNCTION__); 135 report_no_entries(__FUNCTION__);
137 #endif 136 #endif
138 const Entry* entries = gEntries; 137 const Entry* entries = gEntries;
139 for (int i = gCount - 1; i >= 0; --i) { 138 for (int i = gCount - 1; i >= 0; --i) {
140 if (entries[i].fFactory == fact) { 139 if (entries[i].fFactory == fact) {
141 return entries[i].fName; 140 return entries[i].fName;
142 } 141 }
143 } 142 }
144 return NULL; 143 return NULL;
145 } 144 }
OLDNEW
« no previous file with comments | « src/core/SkFilterShader.cpp ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698