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

Side by Side Diff: src/core/SkWriteBuffer.cpp

Issue 130913018: Templetized SkWriter32 readTAt() & overwriteTAt() (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Rebased Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/core/SkPictureRecord.cpp ('k') | src/core/SkWriter32.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkWriteBuffer.h" 9 #include "SkWriteBuffer.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 } 314 }
315 315
316 // make room for the size of the flattened object 316 // make room for the size of the flattened object
317 (void)fWriter.reserve(sizeof(uint32_t)); 317 (void)fWriter.reserve(sizeof(uint32_t));
318 // record the current size, so we can subtract after the object writes. 318 // record the current size, so we can subtract after the object writes.
319 size_t offset = fWriter.bytesWritten(); 319 size_t offset = fWriter.bytesWritten();
320 // now flatten the object 320 // now flatten the object
321 flattenable->flatten(*this); 321 flattenable->flatten(*this);
322 size_t objSize = fWriter.bytesWritten() - offset; 322 size_t objSize = fWriter.bytesWritten() - offset;
323 // record the obj's size 323 // record the obj's size
324 fWriter.write32At(offset - sizeof(uint32_t), SkToU32(objSize)); 324 fWriter.overwriteTAt(offset - sizeof(uint32_t), SkToU32(objSize));
325 } 325 }
OLDNEW
« no previous file with comments | « src/core/SkPictureRecord.cpp ('k') | src/core/SkWriter32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698