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

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

Issue 1548223002: remove cruft from SkTypes.h, including SkBool (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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') | src/utils/SkInterpolator.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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 default: 77 default:
78 SkDEBUGFAIL("never gets here"); 78 SkDEBUGFAIL("never gets here");
79 } 79 }
80 } 80 }
81 81
82 template <typename T> class SkRefCntTDArray : public SkTDArray<T> { 82 template <typename T> class SkRefCntTDArray : public SkTDArray<T> {
83 public: 83 public:
84 ~SkRefCntTDArray() { this->unrefAll(); } 84 ~SkRefCntTDArray() { this->unrefAll(); }
85 }; 85 };
86 86
87 static inline uint32_t set_clear_mask(uint32_t bits, bool cond, uint32_t mask) {
88 return cond ? bits | mask : bits & ~mask;
89 }
90
87 class SkGPipeState : public SkBitmapHeapReader { 91 class SkGPipeState : public SkBitmapHeapReader {
88 public: 92 public:
89 SkGPipeState(); 93 SkGPipeState();
90 ~SkGPipeState(); 94 ~SkGPipeState();
91 95
92 void setSilent(bool silent) { 96 void setSilent(bool silent) {
93 fSilent = silent; 97 fSilent = silent;
94 } 98 }
95 99
96 bool shouldDraw() { 100 bool shouldDraw() {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 const SkImage* getImage(int32_t slot) const { 210 const SkImage* getImage(int32_t slot) const {
207 return fImageHeap->get(slot); 211 return fImageHeap->get(slot);
208 } 212 }
209 213
210 private: 214 private:
211 void updateReader() { 215 void updateReader() {
212 if (nullptr == fReader) { 216 if (nullptr == fReader) {
213 return; 217 return;
214 } 218 }
215 bool crossProcess = SkToBool(fFlags & SkGPipeWriter::kCrossProcess_Flag) ; 219 bool crossProcess = SkToBool(fFlags & SkGPipeWriter::kCrossProcess_Flag) ;
216 fReader->setFlags(SkSetClearMask(fReader->getFlags(), crossProcess, 220 fReader->setFlags(set_clear_mask(fReader->getFlags(), crossProcess,
217 SkReadBuffer::kCrossProcess_Flag)); 221 SkReadBuffer::kCrossProcess_Flag));
218 if (crossProcess) { 222 if (crossProcess) {
219 fReader->setFactoryArray(&fFactoryArray); 223 fReader->setFactoryArray(&fFactoryArray);
220 } else { 224 } else {
221 fReader->setFactoryArray(nullptr); 225 fReader->setFactoryArray(nullptr);
222 } 226 }
223 227
224 if (shouldFlattenBitmaps(fFlags)) { 228 if (shouldFlattenBitmaps(fFlags)) {
225 fReader->setBitmapStorage(this); 229 fReader->setBitmapStorage(this);
226 } else { 230 } else {
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 status = kReadAtom_Status; 1000 status = kReadAtom_Status;
997 break; 1001 break;
998 } 1002 }
999 } 1003 }
1000 1004
1001 if (bytesRead) { 1005 if (bytesRead) {
1002 *bytesRead = reader.offset(); 1006 *bytesRead = reader.offset();
1003 } 1007 }
1004 return status; 1008 return status;
1005 } 1009 }
OLDNEW
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/utils/SkInterpolator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698