Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: src/core/SkCanvas.cpp

Issue 137833016: add SkCanvas constructor that explicitly creates no_config with dimensions (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/utils/SkDumpCanvas.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 fMCRec->fLayer = SkNEW_ARGS(DeviceCM, (NULL, 0, 0, NULL, NULL)); 498 fMCRec->fLayer = SkNEW_ARGS(DeviceCM, (NULL, 0, 0, NULL, NULL));
499 fMCRec->fTopLayer = fMCRec->fLayer; 499 fMCRec->fTopLayer = fMCRec->fLayer;
500 fMCRec->fNext = NULL; 500 fMCRec->fNext = NULL;
501 501
502 fSurfaceBase = NULL; 502 fSurfaceBase = NULL;
503 503
504 return this->setDevice(device); 504 return this->setDevice(device);
505 } 505 }
506 506
507 SkCanvas::SkCanvas() 507 SkCanvas::SkCanvas()
508 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) { 508 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
509 {
509 inc_canvas(); 510 inc_canvas();
510 511
511 this->init(NULL); 512 this->init(NULL);
512 } 513 }
513 514
515 SkCanvas::SkCanvas(int width, int height)
516 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
517 {
518 inc_canvas();
519
520 SkBitmap bitmap;
521 bitmap.setConfig(SkBitmap::kNo_Config, width, height);
522 this->init(SkNEW_ARGS(SkBitmapDevice, (bitmap)))->unref();
523 }
524
514 SkCanvas::SkCanvas(SkBaseDevice* device) 525 SkCanvas::SkCanvas(SkBaseDevice* device)
515 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) { 526 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
527 {
516 inc_canvas(); 528 inc_canvas();
517 529
518 this->init(device); 530 this->init(device);
519 } 531 }
520 532
521 SkCanvas::SkCanvas(const SkBitmap& bitmap) 533 SkCanvas::SkCanvas(const SkBitmap& bitmap)
522 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) { 534 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
535 {
523 inc_canvas(); 536 inc_canvas();
524 537
525 this->init(SkNEW_ARGS(SkBitmapDevice, (bitmap)))->unref(); 538 this->init(SkNEW_ARGS(SkBitmapDevice, (bitmap)))->unref();
526 } 539 }
527 540
528 SkCanvas::~SkCanvas() { 541 SkCanvas::~SkCanvas() {
529 // free up the contents of our deque 542 // free up the contents of our deque
530 this->restoreToCount(1); // restore everything but the last 543 this->restoreToCount(1); // restore everything but the last
531 SkASSERT(0 == fSaveLayerCount); 544 SkASSERT(0 == fSaveLayerCount);
532 545
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after
2205 return *paint; 2218 return *paint;
2206 } 2219 }
2207 2220
2208 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } 2221 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); }
2209 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } 2222 int SkCanvas::LayerIter::x() const { return fImpl->getX(); }
2210 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } 2223 int SkCanvas::LayerIter::y() const { return fImpl->getY(); }
2211 2224
2212 /////////////////////////////////////////////////////////////////////////////// 2225 ///////////////////////////////////////////////////////////////////////////////
2213 2226
2214 SkCanvas::ClipVisitor::~ClipVisitor() { } 2227 SkCanvas::ClipVisitor::~ClipVisitor() { }
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/utils/SkDumpCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698