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