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

Side by Side Diff: src/codec/SkStreamBuffer.cpp

Issue 2045293002: Add support for multiple frames in SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix a test - we now draw transparent background for missing color table Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « src/codec/SkStreamBuffer.h ('k') | src/codec/SkSwizzler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "SkStreamBuffer.h"
9
10 SkStreamBuffer::SkStreamBuffer(SkStream* stream)
11 : fStream(stream)
12 , fBytesBuffered(0)
13 {}
14
15 size_t SkStreamBuffer::buffer(size_t bytesToBuffer) {
16 // FIXME (scroggo): What should we do if the client tries to read too much?
17 // Should not be a problem in GIF.
18 SkASSERT(fBytesBuffered + bytesToBuffer <= kMaxSize);
19
20 const size_t bytesBuffered = fStream->read(fBuffer + fBytesBuffered, bytesTo Buffer);
21 fBytesBuffered += bytesBuffered;
22 return bytesBuffered;
23 }
OLDNEW
« no previous file with comments | « src/codec/SkStreamBuffer.h ('k') | src/codec/SkSwizzler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698