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

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

Issue 768183002: Revert of Remove SK_SUPPORT_LEGACY_DEEPFLATTENING. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/SkLocalMatrixShader.h » ('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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * 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
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkFlattenable.h" 8 #include "SkFlattenable.h"
9 #include "SkPtrRecorder.h" 9 #include "SkPtrRecorder.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
11 11
12 ///////////////////////////////////////////////////////////////////////////////
13
14 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
15 bool SkFlattenable::NeedsDeepUnflatten(const SkReadBuffer& buffer) {
16 return false; // TODO: looks like all this can go away too now?
17 }
18 #endif
19
20 ///////////////////////////////////////////////////////////////////////////////
21
12 SkNamedFactorySet::SkNamedFactorySet() : fNextAddedFactory(0) {} 22 SkNamedFactorySet::SkNamedFactorySet() : fNextAddedFactory(0) {}
13 23
14 uint32_t SkNamedFactorySet::find(SkFlattenable::Factory factory) { 24 uint32_t SkNamedFactorySet::find(SkFlattenable::Factory factory) {
15 uint32_t index = fFactorySet.find(factory); 25 uint32_t index = fFactorySet.find(factory);
16 if (index > 0) { 26 if (index > 0) {
17 return index; 27 return index;
18 } 28 }
19 const char* name = SkFlattenable::FactoryToName(factory); 29 const char* name = SkFlattenable::FactoryToName(factory);
20 if (NULL == name) { 30 if (NULL == name) {
21 return 0; 31 return 0;
(...skipping 18 matching lines...) Expand all
40 50
41 void SkRefCntSet::incPtr(void* ptr) { 51 void SkRefCntSet::incPtr(void* ptr) {
42 ((SkRefCnt*)ptr)->ref(); 52 ((SkRefCnt*)ptr)->ref();
43 } 53 }
44 54
45 void SkRefCntSet::decPtr(void* ptr) { 55 void SkRefCntSet::decPtr(void* ptr) {
46 ((SkRefCnt*)ptr)->unref(); 56 ((SkRefCnt*)ptr)->unref();
47 } 57 }
48 58
49 /////////////////////////////////////////////////////////////////////////////// 59 ///////////////////////////////////////////////////////////////////////////////
60 ///////////////////////////////////////////////////////////////////////////////
61 ///////////////////////////////////////////////////////////////////////////////
50 62
51 #define MAX_ENTRY_COUNT 1024 63 #define MAX_ENTRY_COUNT 1024
52 64
53 struct Entry { 65 struct Entry {
54 const char* fName; 66 const char* fName;
55 SkFlattenable::Factory fFactory; 67 SkFlattenable::Factory fFactory;
56 SkFlattenable::Type fType; 68 SkFlattenable::Type fType;
57 }; 69 };
58 70
59 static int gCount; 71 static int gCount;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 report_no_entries(__FUNCTION__); 135 report_no_entries(__FUNCTION__);
124 #endif 136 #endif
125 const Entry* entries = gEntries; 137 const Entry* entries = gEntries;
126 for (int i = gCount - 1; i >= 0; --i) { 138 for (int i = gCount - 1; i >= 0; --i) {
127 if (entries[i].fFactory == fact) { 139 if (entries[i].fFactory == fact) {
128 return entries[i].fName; 140 return entries[i].fName;
129 } 141 }
130 } 142 }
131 return NULL; 143 return NULL;
132 } 144 }
OLDNEW
« no previous file with comments | « src/core/SkFilterShader.cpp ('k') | src/core/SkLocalMatrixShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698