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

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

Issue 14230022: Fixes for piping bitmaps with encoded data. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Add some asserts and comments. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/pipe/SkGPipeRead.cpp ('k') | src/pipe/utils/SamplePipeControllers.h » ('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 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 "SkBitmapHeap.h" 10 #include "SkBitmapHeap.h"
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 this->writeOp(kDef_Factory_DrawOp); 336 this->writeOp(kDef_Factory_DrawOp);
337 fWriter.writeString(name, len); 337 fWriter.writeString(name, len);
338 } 338 }
339 } 339 }
340 } 340 }
341 341
342 bool SkGPipeCanvas::shuttleBitmap(const SkBitmap& bm, int32_t slot) { 342 bool SkGPipeCanvas::shuttleBitmap(const SkBitmap& bm, int32_t slot) {
343 SkASSERT(shouldFlattenBitmaps(fFlags)); 343 SkASSERT(shouldFlattenBitmaps(fFlags));
344 SkOrderedWriteBuffer buffer(1024); 344 SkOrderedWriteBuffer buffer(1024);
345 buffer.setNamedFactoryRecorder(fFactorySet); 345 buffer.setNamedFactoryRecorder(fFactorySet);
346 bm.flatten(buffer); 346 buffer.writeBitmap(bm);
347 this->flattenFactoryNames(); 347 this->flattenFactoryNames();
348 uint32_t size = buffer.size(); 348 uint32_t size = buffer.size();
349 if (this->needOpBytes(size)) { 349 if (this->needOpBytes(size)) {
350 this->writeOp(kDef_Bitmap_DrawOp, 0, slot); 350 this->writeOp(kDef_Bitmap_DrawOp, 0, slot);
351 void* dst = static_cast<void*>(fWriter.reserve(size)); 351 void* dst = static_cast<void*>(fWriter.reserve(size));
352 buffer.writeToMemory(dst); 352 buffer.writeToMemory(dst);
353 return true; 353 return true;
354 } 354 }
355 return false; 355 return false;
356 } 356 }
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 fCanvas->ref(); 1171 fCanvas->ref();
1172 } 1172 }
1173 1173
1174 BitmapShuttle::~BitmapShuttle() { 1174 BitmapShuttle::~BitmapShuttle() {
1175 fCanvas->unref(); 1175 fCanvas->unref();
1176 } 1176 }
1177 1177
1178 bool BitmapShuttle::insert(const SkBitmap& bitmap, int32_t slot) { 1178 bool BitmapShuttle::insert(const SkBitmap& bitmap, int32_t slot) {
1179 return fCanvas->shuttleBitmap(bitmap, slot); 1179 return fCanvas->shuttleBitmap(bitmap, slot);
1180 } 1180 }
OLDNEW
« no previous file with comments | « src/pipe/SkGPipeRead.cpp ('k') | src/pipe/utils/SamplePipeControllers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698