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

Unified Diff: src/core/SkRWBuffer.cpp

Issue 1574603002: Make SkROBuffer::Iter::size() work when exhausted (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/DataRefTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRWBuffer.cpp
diff --git a/src/core/SkRWBuffer.cpp b/src/core/SkRWBuffer.cpp
index e9147dc684f78aab570b281119e7e738d3a6287e..0784378d99a77d9c084f02d4f6b7d57476b7ae60 100644
--- a/src/core/SkRWBuffer.cpp
+++ b/src/core/SkRWBuffer.cpp
@@ -150,6 +150,9 @@ const void* SkROBuffer::Iter::data() const {
}
size_t SkROBuffer::Iter::size() const {
+ if (!fBlock) {
+ return 0;
+ }
return SkTMin(fBlock->fUsed, fRemaining);
}
« no previous file with comments | « no previous file | tests/DataRefTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698