OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2008 The Android Open Source Project | 3 * Copyright 2008 The Android Open Source Project |
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 | 9 |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 | 492 |
493 this->init(NULL); | 493 this->init(NULL); |
494 } | 494 } |
495 | 495 |
496 SkCanvas::SkCanvas(int width, int height) | 496 SkCanvas::SkCanvas(int width, int height) |
497 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) | 497 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) |
498 { | 498 { |
499 inc_canvas(); | 499 inc_canvas(); |
500 | 500 |
501 SkBitmap bitmap; | 501 SkBitmap bitmap; |
502 bitmap.setInfo(SkImageInfo::MakeUnknown(width, height)); | 502 bitmap.setConfig(SkImageInfo::MakeUnknown(width, height)); |
503 this->init(SkNEW_ARGS(SkBitmapDevice, (bitmap)))->unref(); | 503 this->init(SkNEW_ARGS(SkBitmapDevice, (bitmap)))->unref(); |
504 } | 504 } |
505 | 505 |
506 SkCanvas::SkCanvas(SkBaseDevice* device) | 506 SkCanvas::SkCanvas(SkBaseDevice* device) |
507 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) | 507 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) |
508 { | 508 { |
509 inc_canvas(); | 509 inc_canvas(); |
510 | 510 |
511 this->init(device); | 511 this->init(device); |
512 } | 512 } |
(...skipping 2113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2626 if (!supported_for_raster_canvas(info)) { | 2626 if (!supported_for_raster_canvas(info)) { |
2627 return NULL; | 2627 return NULL; |
2628 } | 2628 } |
2629 | 2629 |
2630 SkBitmap bitmap; | 2630 SkBitmap bitmap; |
2631 if (!bitmap.installPixels(info, pixels, rowBytes)) { | 2631 if (!bitmap.installPixels(info, pixels, rowBytes)) { |
2632 return NULL; | 2632 return NULL; |
2633 } | 2633 } |
2634 return SkNEW_ARGS(SkCanvas, (bitmap)); | 2634 return SkNEW_ARGS(SkCanvas, (bitmap)); |
2635 } | 2635 } |
OLD | NEW |