OLD | NEW |
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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 fDone = false; | 424 fDone = false; |
425 fBlockSize = 0; // need first block from controller | 425 fBlockSize = 0; // need first block from controller |
426 fBytesNotified = 0; | 426 fBytesNotified = 0; |
427 fFirstSaveLayerStackLevel = kNoSaveLayer; | 427 fFirstSaveLayerStackLevel = kNoSaveLayer; |
428 sk_bzero(fCurrFlatIndex, sizeof(fCurrFlatIndex)); | 428 sk_bzero(fCurrFlatIndex, sizeof(fCurrFlatIndex)); |
429 | 429 |
430 // we need a device to limit our clip | 430 // we need a device to limit our clip |
431 // We don't allocate pixels for the bitmap | 431 // We don't allocate pixels for the bitmap |
432 SkBitmap bitmap; | 432 SkBitmap bitmap; |
433 bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height); | 433 bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height); |
434 SkDevice* device = SkNEW_ARGS(SkDevice, (bitmap)); | 434 SkDevice* device = SkNEW_ARGS(SkRasterDevice, (bitmap)); |
435 this->setDevice(device)->unref(); | 435 this->setDevice(device)->unref(); |
436 | 436 |
437 // Tell the reader the appropriate flags to use. | 437 // Tell the reader the appropriate flags to use. |
438 if (this->needOpBytes()) { | 438 if (this->needOpBytes()) { |
439 this->writeOp(kReportFlags_DrawOp, fFlags, 0); | 439 this->writeOp(kReportFlags_DrawOp, fFlags, 0); |
440 } | 440 } |
441 | 441 |
442 if (shouldFlattenBitmaps(flags)) { | 442 if (shouldFlattenBitmaps(flags)) { |
443 BitmapShuttle* shuttle = SkNEW_ARGS(BitmapShuttle, (this)); | 443 BitmapShuttle* shuttle = SkNEW_ARGS(BitmapShuttle, (this)); |
444 fBitmapHeap = SkNEW_ARGS(SkBitmapHeap, (shuttle, BITMAPS_TO_KEEP)); | 444 fBitmapHeap = SkNEW_ARGS(SkBitmapHeap, (shuttle, BITMAPS_TO_KEEP)); |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 fCanvas->ref(); | 1186 fCanvas->ref(); |
1187 } | 1187 } |
1188 | 1188 |
1189 BitmapShuttle::~BitmapShuttle() { | 1189 BitmapShuttle::~BitmapShuttle() { |
1190 fCanvas->unref(); | 1190 fCanvas->unref(); |
1191 } | 1191 } |
1192 | 1192 |
1193 bool BitmapShuttle::insert(const SkBitmap& bitmap, int32_t slot) { | 1193 bool BitmapShuttle::insert(const SkBitmap& bitmap, int32_t slot) { |
1194 return fCanvas->shuttleBitmap(bitmap, slot); | 1194 return fCanvas->shuttleBitmap(bitmap, slot); |
1195 } | 1195 } |
OLD | NEW |