OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 The Android Open Source Project |
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 "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkCanvasPriv.h" | 9 #include "SkCanvasPriv.h" |
10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } | 264 } |
265 } | 265 } |
266 | 266 |
267 const DeviceCM* rec = fCurrLayer; | 267 const DeviceCM* rec = fCurrLayer; |
268 if (rec && rec->fDevice) { | 268 if (rec && rec->fDevice) { |
269 | 269 |
270 fMatrix = rec->fMatrix; | 270 fMatrix = rec->fMatrix; |
271 fClip = &((SkRasterClip*)&rec->fClip)->forceGetBW(); | 271 fClip = &((SkRasterClip*)&rec->fClip)->forceGetBW(); |
272 fRC = &rec->fClip; | 272 fRC = &rec->fClip; |
273 fDevice = rec->fDevice; | 273 fDevice = rec->fDevice; |
274 fBitmap = &fDevice->accessBitmap(true); | 274 if (!fDevice->accessPixels(&fDst)) { |
| 275 fDst.reset(fDevice->imageInfo(), NULL, 0); |
| 276 } |
275 fPaint = rec->fPaint; | 277 fPaint = rec->fPaint; |
276 SkDEBUGCODE(this->validate();) | 278 SkDEBUGCODE(this->validate();) |
277 | 279 |
278 fCurrLayer = rec->fNext; | 280 fCurrLayer = rec->fNext; |
279 // fCurrLayer may be NULL now | 281 // fCurrLayer may be NULL now |
280 | 282 |
281 return true; | 283 return true; |
282 } | 284 } |
283 return false; | 285 return false; |
284 } | 286 } |
(...skipping 2426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2711 } | 2713 } |
2712 | 2714 |
2713 if (matrix) { | 2715 if (matrix) { |
2714 canvas->concat(*matrix); | 2716 canvas->concat(*matrix); |
2715 } | 2717 } |
2716 } | 2718 } |
2717 | 2719 |
2718 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 2720 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
2719 fCanvas->restoreToCount(fSaveCount); | 2721 fCanvas->restoreToCount(fSaveCount); |
2720 } | 2722 } |
OLD | NEW |