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 "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkCanvasPriv.h" | 10 #include "SkCanvasPriv.h" |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 fMatrix.reset(); | 313 fMatrix.reset(); |
314 fRasterClip.setRect(bounds); | 314 fRasterClip.setRect(bounds); |
315 fLayer->reset(bounds); | 315 fLayer->reset(bounds); |
316 } | 316 } |
317 }; | 317 }; |
318 | 318 |
319 class SkDrawIter : public SkDraw { | 319 class SkDrawIter : public SkDraw { |
320 public: | 320 public: |
321 SkDrawIter(SkCanvas* canvas) { | 321 SkDrawIter(SkCanvas* canvas) { |
322 canvas = canvas->canvasForDrawIter(); | 322 canvas = canvas->canvasForDrawIter(); |
323 fCanvas = canvas; | |
324 canvas->updateDeviceCMCache(); | 323 canvas->updateDeviceCMCache(); |
325 | 324 |
326 fClipStack = canvas->fClipStack; | 325 fClipStack = canvas->fClipStack; |
327 fCurrLayer = canvas->fMCRec->fTopLayer; | 326 fCurrLayer = canvas->fMCRec->fTopLayer; |
328 } | 327 } |
329 | 328 |
330 bool next() { | 329 bool next() { |
331 // skip over recs with empty clips | 330 // skip over recs with empty clips |
332 while (fCurrLayer && fCurrLayer->fClip.isEmpty()) { | 331 while (fCurrLayer && fCurrLayer->fClip.isEmpty()) { |
333 fCurrLayer = fCurrLayer->fNext; | 332 fCurrLayer = fCurrLayer->fNext; |
(...skipping 20 matching lines...) Expand all Loading... |
354 } | 353 } |
355 | 354 |
356 SkBaseDevice* getDevice() const { return fDevice; } | 355 SkBaseDevice* getDevice() const { return fDevice; } |
357 const SkRasterClip& getClip() const { return *fRC; } | 356 const SkRasterClip& getClip() const { return *fRC; } |
358 int getX() const { return fDevice->getOrigin().x(); } | 357 int getX() const { return fDevice->getOrigin().x(); } |
359 int getY() const { return fDevice->getOrigin().y(); } | 358 int getY() const { return fDevice->getOrigin().y(); } |
360 const SkMatrix& getMatrix() const { return *fMatrix; } | 359 const SkMatrix& getMatrix() const { return *fMatrix; } |
361 const SkPaint* getPaint() const { return fPaint; } | 360 const SkPaint* getPaint() const { return fPaint; } |
362 | 361 |
363 private: | 362 private: |
364 SkCanvas* fCanvas; | |
365 const DeviceCM* fCurrLayer; | 363 const DeviceCM* fCurrLayer; |
366 const SkPaint* fPaint; // May be null. | 364 const SkPaint* fPaint; // May be null. |
367 | 365 |
368 typedef SkDraw INHERITED; | 366 typedef SkDraw INHERITED; |
369 }; | 367 }; |
370 | 368 |
371 ///////////////////////////////////////////////////////////////////////////// | 369 ///////////////////////////////////////////////////////////////////////////// |
372 | 370 |
373 static SkPaint* set_if_needed(SkLazyPaint* lazy, const SkPaint& orig) { | 371 static SkPaint* set_if_needed(SkLazyPaint* lazy, const SkPaint& orig) { |
374 return lazy->isValid() ? lazy->get() : lazy->set(orig); | 372 return lazy->isValid() ? lazy->get() : lazy->set(orig); |
(...skipping 3019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3394 | 3392 |
3395 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 3393 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
3396 fCanvas->restoreToCount(fSaveCount); | 3394 fCanvas->restoreToCount(fSaveCount); |
3397 } | 3395 } |
3398 | 3396 |
3399 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API | 3397 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API |
3400 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { | 3398 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { |
3401 return this->makeSurface(info, props).release(); | 3399 return this->makeSurface(info, props).release(); |
3402 } | 3400 } |
3403 #endif | 3401 #endif |
OLD | NEW |