aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-12-07 13:52:08 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-07 19:20:59 +0000
commit75d55d3d4509669009d6202cab23ce9320fe8577 (patch)
tree6e95d73ddf6c42f7ac67dad0a9460b0f0a552fb2 /src/core
parent04460ccee50e03b89420cdaa85882a9da083fa38 (diff)
don't read directly from fReader for bare types, need available check
Bug:792810 Change-Id: Ibb9d4b1dff05d48d7cb6674acf88a7a461bca818 Reviewed-on: https://skia-review.googlesource.com/82180 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkReadBuffer.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/SkReadBuffer.cpp b/src/core/SkReadBuffer.cpp
index 06457fa8d8..78071ee227 100644
--- a/src/core/SkReadBuffer.cpp
+++ b/src/core/SkReadBuffer.cpp
@@ -196,14 +196,14 @@ void SkReadBuffer::readColor4f(SkColor4f* color) {
}
void SkReadBuffer::readPoint(SkPoint* point) {
- point->fX = fReader.readScalar();
- point->fY = fReader.readScalar();
+ point->fX = this->readScalar();
+ point->fY = this->readScalar();
}
void SkReadBuffer::readPoint3(SkPoint3* point) {
- point->fX = fReader.readScalar();
- point->fY = fReader.readScalar();
- point->fZ = fReader.readScalar();
+ point->fX = this->readScalar();
+ point->fY = this->readScalar();
+ point->fZ = this->readScalar();
}
void SkReadBuffer::readMatrix(SkMatrix* matrix) {
@@ -417,7 +417,7 @@ SkFlattenable* SkReadBuffer::readFlattenable(SkFlattenable::Type ft) {
} else {
// Read the index. We are guaranteed that the first byte
// is zeroed, so we must shift down a byte.
- uint32_t index = fReader.readU32() >> 8;
+ uint32_t index = this->read32() >> 8;
if (!this->validate(index > 0)) {
return nullptr; // writer failed to give us the flattenable
}
@@ -440,7 +440,7 @@ SkFlattenable* SkReadBuffer::readFlattenable(SkFlattenable::Type ft) {
// if we get here, factory may still be null, but if that is the case, the
// failure was ours, not the writer.
sk_sp<SkFlattenable> obj;
- uint32_t sizeRecorded = fReader.readU32();
+ uint32_t sizeRecorded = this->read32();
if (factory) {
size_t offset = fReader.offset();
obj = (*factory)(*this);