aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPaint.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-01-03 11:32:13 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-03 18:13:39 +0000
commitd1c65d6708de536a5971575809d7172fa4f54b37 (patch)
tree33853164c19762d89e3a1ce7e1a48f81ac77d9a0 /src/core/SkPaint.cpp
parent314d7c267f968643966d0e9678db9ef4e53456a4 (diff)
remove unneeded readbuffer flags
- buffers are always 'cross-process' - readbuffer is always validating Bug:796107 Change-Id: I59614e9c29490c0b029c60d2aafe2806671bc9e1 Reviewed-on: https://skia-review.googlesource.com/90560 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkPaint.cpp')
-rw-r--r--src/core/SkPaint.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index f8e5c11efd..0987c640c1 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -1865,17 +1865,16 @@ static FlatFlags unpack_paint_flags(SkPaint* paint, uint32_t packed) {
it if there are not tricky elements like shaders, etc.
*/
void SkPaint::flatten(SkWriteBuffer& buffer) const {
- // If the writer is xprocess, then we force recording our typeface, even if its "default"
- // since the other process may have a different notion of default.
SkTypeface* tf = this->getTypeface();
- if (!tf && buffer.isCrossProcess()) {
+ if (!tf) {
+ // We force recording our typeface, even if its "default" since the receiver process
+ // may have a different notion of default.
tf = SkTypeface::GetDefaultTypeface();
+ SkASSERT(tf);
}
- uint8_t flatFlags = 0;
- if (tf) {
- flatFlags |= kHasTypeface_FlatFlag;
- }
+ uint8_t flatFlags = kHasTypeface_FlatFlag;
+
if (asint(this->getPathEffect()) |
asint(this->getShader()) |
asint(this->getMaskFilter()) |
@@ -1899,11 +1898,8 @@ void SkPaint::flatten(SkWriteBuffer& buffer) const {
(this->getStyle() << 4) | this->getTextEncoding(),
fBlendMode));
- // now we're done with ptr and the (pre)reserved space. If we need to write
- // additional fields, use the buffer directly
- if (flatFlags & kHasTypeface_FlatFlag) {
- buffer.writeTypeface(tf);
- }
+ buffer.writeTypeface(tf);
+
if (flatFlags & kHasEffects_FlatFlag) {
buffer.writeFlattenable(this->getPathEffect());
buffer.writeFlattenable(this->getShader());