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 "SkBitmapDevice.h" |
10 #include "SkBitmapHeap.h" | 11 #include "SkBitmapHeap.h" |
11 #include "SkCanvas.h" | 12 #include "SkCanvas.h" |
12 #include "SkColorFilter.h" | 13 #include "SkColorFilter.h" |
13 #include "SkData.h" | 14 #include "SkData.h" |
14 #include "SkDrawLooper.h" | 15 #include "SkDrawLooper.h" |
15 #include "SkDevice.h" | |
16 #include "SkGPipe.h" | 16 #include "SkGPipe.h" |
17 #include "SkGPipePriv.h" | 17 #include "SkGPipePriv.h" |
18 #include "SkImageFilter.h" | 18 #include "SkImageFilter.h" |
19 #include "SkMaskFilter.h" | 19 #include "SkMaskFilter.h" |
20 #include "SkOrderedWriteBuffer.h" | 20 #include "SkOrderedWriteBuffer.h" |
21 #include "SkPaint.h" | 21 #include "SkPaint.h" |
22 #include "SkPathEffect.h" | 22 #include "SkPathEffect.h" |
23 #include "SkPictureFlat.h" | 23 #include "SkPictureFlat.h" |
24 #include "SkRasterizer.h" | 24 #include "SkRasterizer.h" |
25 #include "SkRRect.h" | 25 #include "SkRRect.h" |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 fDone = false; | 425 fDone = false; |
426 fBlockSize = 0; // need first block from controller | 426 fBlockSize = 0; // need first block from controller |
427 fBytesNotified = 0; | 427 fBytesNotified = 0; |
428 fFirstSaveLayerStackLevel = kNoSaveLayer; | 428 fFirstSaveLayerStackLevel = kNoSaveLayer; |
429 sk_bzero(fCurrFlatIndex, sizeof(fCurrFlatIndex)); | 429 sk_bzero(fCurrFlatIndex, sizeof(fCurrFlatIndex)); |
430 | 430 |
431 // we need a device to limit our clip | 431 // we need a device to limit our clip |
432 // We don't allocate pixels for the bitmap | 432 // We don't allocate pixels for the bitmap |
433 SkBitmap bitmap; | 433 SkBitmap bitmap; |
434 bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height); | 434 bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height); |
435 SkDevice* device = SkNEW_ARGS(SkDevice, (bitmap)); | 435 SkBaseDevice* device = SkNEW_ARGS(SkBitmapDevice, (bitmap)); |
436 this->setDevice(device)->unref(); | 436 this->setDevice(device)->unref(); |
437 | 437 |
438 // Tell the reader the appropriate flags to use. | 438 // Tell the reader the appropriate flags to use. |
439 if (this->needOpBytes()) { | 439 if (this->needOpBytes()) { |
440 this->writeOp(kReportFlags_DrawOp, fFlags, 0); | 440 this->writeOp(kReportFlags_DrawOp, fFlags, 0); |
441 } | 441 } |
442 | 442 |
443 if (shouldFlattenBitmaps(flags)) { | 443 if (shouldFlattenBitmaps(flags)) { |
444 BitmapShuttle* shuttle = SkNEW_ARGS(BitmapShuttle, (this)); | 444 BitmapShuttle* shuttle = SkNEW_ARGS(BitmapShuttle, (this)); |
445 fBitmapHeap = SkNEW_ARGS(SkBitmapHeap, (shuttle, BITMAPS_TO_KEEP)); | 445 fBitmapHeap = SkNEW_ARGS(SkBitmapHeap, (shuttle, BITMAPS_TO_KEEP)); |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 fCanvas->ref(); | 1191 fCanvas->ref(); |
1192 } | 1192 } |
1193 | 1193 |
1194 BitmapShuttle::~BitmapShuttle() { | 1194 BitmapShuttle::~BitmapShuttle() { |
1195 fCanvas->unref(); | 1195 fCanvas->unref(); |
1196 } | 1196 } |
1197 | 1197 |
1198 bool BitmapShuttle::insert(const SkBitmap& bitmap, int32_t slot) { | 1198 bool BitmapShuttle::insert(const SkBitmap& bitmap, int32_t slot) { |
1199 return fCanvas->shuttleBitmap(bitmap, slot); | 1199 return fCanvas->shuttleBitmap(bitmap, slot); |
1200 } | 1200 } |
OLD | NEW |