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

Unified Diff: include/core/SkWriteBuffer.h

Issue 138803005: Set write buffer flags only in SkWriteBuffer and SkFlatController constructors. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: INHERITED Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkFlattenableSerialization.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkWriteBuffer.h
diff --git a/include/core/SkWriteBuffer.h b/include/core/SkWriteBuffer.h
index ab56f9d48d9ac02c4513525492324d4439d4ac35..332dfaea40e56d48a1e3f1dc37ab8cdecf11077d 100644
--- a/include/core/SkWriteBuffer.h
+++ b/include/core/SkWriteBuffer.h
@@ -24,18 +24,15 @@ class SkRefCntSet;
class SkWriteBuffer {
public:
- SkWriteBuffer();
- SkWriteBuffer(void* initialStorage, size_t storageSize);
- ~SkWriteBuffer();
-
enum Flags {
kCrossProcess_Flag = 1 << 0,
kValidation_Flag = 1 << 1,
};
- void setFlags(uint32_t flags) { fFlags = flags; }
- uint32_t getFlags() const { return fFlags; }
- bool isValidating() const { return SkToBool(fFlags & kValidation_Flag); }
+ SkWriteBuffer(uint32_t flags = 0);
+ SkWriteBuffer(void* initialStorage, size_t storageSize, uint32_t flags = 0);
+ ~SkWriteBuffer();
+
bool isCrossProcess() const {
return this->isValidating() || SkToBool(fFlags & kCrossProcess_Flag);
}
@@ -107,7 +104,9 @@ public:
void setBitmapEncoder(SkPicture::EncodeBitmap bitmapEncoder);
private:
- uint32_t fFlags;
+ bool isValidating() const { return SkToBool(fFlags & kValidation_Flag); }
+
+ const uint32_t fFlags;
SkFactorySet* fFactorySet;
SkNamedFactorySet* fNamedFactorySet;
SkWriter32 fWriter;
« no previous file with comments | « no previous file | src/core/SkFlattenableSerialization.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698