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

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

Issue 1841123002: Reverse dependency between SkScalar.h and SkFixed.h (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « src/core/SkValidatingReadBuffer.cpp ('k') | src/effects/GrCircleBlurFragmentProcessor.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 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkWriteBuffer.h" 8 #include "SkWriteBuffer.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkBitmapHeap.h" 10 #include "SkBitmapHeap.h"
(...skipping 29 matching lines...) Expand all
40 40
41 void SkWriteBuffer::writeByteArray(const void* data, size_t size) { 41 void SkWriteBuffer::writeByteArray(const void* data, size_t size) {
42 fWriter.write32(SkToU32(size)); 42 fWriter.write32(SkToU32(size));
43 fWriter.writePad(data, size); 43 fWriter.writePad(data, size);
44 } 44 }
45 45
46 void SkWriteBuffer::writeBool(bool value) { 46 void SkWriteBuffer::writeBool(bool value) {
47 fWriter.writeBool(value); 47 fWriter.writeBool(value);
48 } 48 }
49 49
50 void SkWriteBuffer::writeFixed(SkFixed value) {
51 fWriter.write32(value);
52 }
53
54 void SkWriteBuffer::writeScalar(SkScalar value) { 50 void SkWriteBuffer::writeScalar(SkScalar value) {
55 fWriter.writeScalar(value); 51 fWriter.writeScalar(value);
56 } 52 }
57 53
58 void SkWriteBuffer::writeScalarArray(const SkScalar* value, uint32_t count) { 54 void SkWriteBuffer::writeScalarArray(const SkScalar* value, uint32_t count) {
59 fWriter.write32(count); 55 fWriter.write32(count);
60 fWriter.write(value, count * sizeof(SkScalar)); 56 fWriter.write(value, count * sizeof(SkScalar));
61 } 57 }
62 58
63 void SkWriteBuffer::writeInt(int32_t value) { 59 void SkWriteBuffer::writeInt(int32_t value) {
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 // make room for the size of the flattened object 326 // make room for the size of the flattened object
331 (void)fWriter.reserve(sizeof(uint32_t)); 327 (void)fWriter.reserve(sizeof(uint32_t));
332 // record the current size, so we can subtract after the object writes. 328 // record the current size, so we can subtract after the object writes.
333 size_t offset = fWriter.bytesWritten(); 329 size_t offset = fWriter.bytesWritten();
334 // now flatten the object 330 // now flatten the object
335 flattenable->flatten(*this); 331 flattenable->flatten(*this);
336 size_t objSize = fWriter.bytesWritten() - offset; 332 size_t objSize = fWriter.bytesWritten() - offset;
337 // record the obj's size 333 // record the obj's size
338 fWriter.overwriteTAt(offset - sizeof(uint32_t), SkToU32(objSize)); 334 fWriter.overwriteTAt(offset - sizeof(uint32_t), SkToU32(objSize));
339 } 335 }
OLDNEW
« no previous file with comments | « src/core/SkValidatingReadBuffer.cpp ('k') | src/effects/GrCircleBlurFragmentProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698