| 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 "SkCanvasDrawable.h" | 9 #include "SkCanvasDrawable.h" |
| 10 #include "SkCanvasPriv.h" | 10 #include "SkCanvasPriv.h" |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 : INHERITED(make_nopixels(bounds.width(), bounds.height())) | 475 : INHERITED(make_nopixels(bounds.width(), bounds.height())) |
| 476 { | 476 { |
| 477 this->setOrigin(bounds.x(), bounds.y()); | 477 this->setOrigin(bounds.x(), bounds.y()); |
| 478 } | 478 } |
| 479 | 479 |
| 480 private: | 480 private: |
| 481 | 481 |
| 482 typedef SkBitmapDevice INHERITED; | 482 typedef SkBitmapDevice INHERITED; |
| 483 }; | 483 }; |
| 484 | 484 |
| 485 SkCanvas::SkCanvas(int width, int height) | 485 SkCanvas::SkCanvas(int width, int height, const SkSurfaceProps* props) |
| 486 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) | 486 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) |
| 487 , fProps(SkSurfaceProps::kLegacyFontHost_InitType) | 487 , fProps(SkSurfacePropsCopyOrDefault(props)) |
| 488 { | 488 { |
| 489 inc_canvas(); | 489 inc_canvas(); |
| 490 | 490 |
| 491 this->init(SkNEW_ARGS(SkNoPixelsBitmapDevice, | 491 this->init(SkNEW_ARGS(SkNoPixelsBitmapDevice, |
| 492 (SkIRect::MakeWH(width, height))), kDefault_InitFlags)
->unref(); | 492 (SkIRect::MakeWH(width, height))), kDefault_InitFlags)
->unref(); |
| 493 } | 493 } |
| 494 | 494 |
| 495 SkCanvas::SkCanvas(const SkIRect& bounds, InitFlags flags) | 495 SkCanvas::SkCanvas(const SkIRect& bounds, InitFlags flags) |
| 496 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) | 496 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) |
| 497 , fProps(SkSurfaceProps::kLegacyFontHost_InitType) | 497 , fProps(SkSurfaceProps::kLegacyFontHost_InitType) |
| (...skipping 2078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2576 } | 2576 } |
| 2577 | 2577 |
| 2578 if (matrix) { | 2578 if (matrix) { |
| 2579 canvas->concat(*matrix); | 2579 canvas->concat(*matrix); |
| 2580 } | 2580 } |
| 2581 } | 2581 } |
| 2582 | 2582 |
| 2583 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 2583 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
| 2584 fCanvas->restoreToCount(fSaveCount); | 2584 fCanvas->restoreToCount(fSaveCount); |
| 2585 } | 2585 } |
| OLD | NEW |