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

Unified Diff: include/core/SkRWBuffer.h

Issue 1871953002: Fixes for SkRWBuffer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Restore original test (in addition to threaded one) Created 4 years, 8 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/SkRWBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkRWBuffer.h
diff --git a/include/core/SkRWBuffer.h b/include/core/SkRWBuffer.h
index d054e0a5fd554f706eb7f012c8dd2702638e69ef..9626d28df9643ee836ba6a1e285ce456ec7101f0 100644
--- a/include/core/SkRWBuffer.h
+++ b/include/core/SkRWBuffer.h
@@ -53,22 +53,25 @@ public:
private:
const SkBufferBlock* fBlock;
size_t fRemaining;
+ const SkROBuffer* fBuffer;
};
private:
- SkROBuffer(const SkBufferHead* head, size_t available);
+ SkROBuffer(const SkBufferHead* head, size_t available, const SkBufferBlock* fTail);
virtual ~SkROBuffer();
- const SkBufferHead* fHead;
- const size_t fAvailable;
+ const SkBufferHead* fHead;
+ const size_t fAvailable;
+ const SkBufferBlock* fTail;
friend class SkRWBuffer;
};
/**
* Accumulates bytes of memory that are "appended" to it, growing internal storage as needed.
- * The growth is done such that at any time, a RBuffer or StreamAsset can be snapped off, which
- * can see the previously stored bytes, but which will be unaware of any future writes.
+ * The growth is done such that at any time in the writer's thread, an RBuffer or StreamAsset
+ * can be snapped off (and safely passed to another thread). The RBuffer/StreamAsset snapshot
+ * can see the previously stored bytes, but will be unaware of any future writes.
*/
class SK_API SkRWBuffer {
public:
« no previous file with comments | « no previous file | src/core/SkRWBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698