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

Side by Side Diff: src/pipe/SkGPipeWrite.cpp

Issue 50523004: Little changes to SkAnnotation in pipe: (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/pipe/SkGPipeRead.cpp ('k') | no next file » | 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 2011 Google Inc. 3 * Copyright 2011 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 "SkAnnotation.h" 9 #include "SkAnnotation.h"
10 #include "SkBitmapDevice.h" 10 #include "SkBitmapDevice.h"
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 for (size_t i = 0; i < size/4; i++) { 1121 for (size_t i = 0; i < size/4; i++) {
1122 // SkDebugf("[%d] %08X\n", i, storage[i]); 1122 // SkDebugf("[%d] %08X\n", i, storage[i]);
1123 } 1123 }
1124 } 1124 }
1125 1125
1126 // 1126 //
1127 // Do these after we've written kPaintOp_DrawOp 1127 // Do these after we've written kPaintOp_DrawOp
1128 1128
1129 if (base.getAnnotation() != paint.getAnnotation()) { 1129 if (base.getAnnotation() != paint.getAnnotation()) {
1130 if (NULL == paint.getAnnotation()) { 1130 if (NULL == paint.getAnnotation()) {
1131 this->writeOp(kSetAnnotation_DrawOp, 0, 0); 1131 if (this->needOpBytes()) {
1132 this->writeOp(kSetAnnotation_DrawOp, 0, 0);
1133 }
1132 } else { 1134 } else {
1133 SkOrderedWriteBuffer buffer(1024); 1135 SkOrderedWriteBuffer buffer(1024);
1134 paint.getAnnotation()->writeToBuffer(buffer); 1136 paint.getAnnotation()->writeToBuffer(buffer);
1135 size = buffer.bytesWritten(); 1137 const size_t size = buffer.bytesWritten();
1136 1138 if (this->needOpBytes(size)) {
1137 SkAutoMalloc storage(size); 1139 this->writeOp(kSetAnnotation_DrawOp, 0, size);
1138 buffer.writeToMemory(storage.get()); 1140 buffer.writeToMemory(fWriter.reserve(size));
1139 1141 }
1140 this->writeOp(kSetAnnotation_DrawOp, 0, 1);
1141 fWriter.write32(size);
1142 fWriter.write(storage.get(), size);
1143 } 1142 }
1144 } 1143 }
1145 } 1144 }
1146 1145
1147 /////////////////////////////////////////////////////////////////////////////// 1146 ///////////////////////////////////////////////////////////////////////////////
1148 1147
1149 #include "SkGPipe.h" 1148 #include "SkGPipe.h"
1150 1149
1151 SkGPipeController::~SkGPipeController() { 1150 SkGPipeController::~SkGPipeController() {
1152 SkSafeUnref(fCanvas); 1151 SkSafeUnref(fCanvas);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 fCanvas->ref(); 1209 fCanvas->ref();
1211 } 1210 }
1212 1211
1213 BitmapShuttle::~BitmapShuttle() { 1212 BitmapShuttle::~BitmapShuttle() {
1214 fCanvas->unref(); 1213 fCanvas->unref();
1215 } 1214 }
1216 1215
1217 bool BitmapShuttle::insert(const SkBitmap& bitmap, int32_t slot) { 1216 bool BitmapShuttle::insert(const SkBitmap& bitmap, int32_t slot) {
1218 return fCanvas->shuttleBitmap(bitmap, slot); 1217 return fCanvas->shuttleBitmap(bitmap, slot);
1219 } 1218 }
OLDNEW
« no previous file with comments | « src/pipe/SkGPipeRead.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698