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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 fAllowSimplifyClip = false; | 523 fAllowSimplifyClip = false; |
524 fDeviceCMDirty = true; | 524 fDeviceCMDirty = true; |
525 fSaveCount = 1; | 525 fSaveCount = 1; |
526 fMetaData = NULL; | 526 fMetaData = NULL; |
527 | 527 |
528 fClipStack.reset(SkNEW(SkClipStack)); | 528 fClipStack.reset(SkNEW(SkClipStack)); |
529 | 529 |
530 fMCRec = (MCRec*)fMCStack.push_back(); | 530 fMCRec = (MCRec*)fMCStack.push_back(); |
531 new (fMCRec) MCRec(fConservativeRasterClip); | 531 new (fMCRec) MCRec(fConservativeRasterClip); |
532 | 532 |
533 SkASSERT(sizeof(DeviceCM) <= sizeof(fBaseLayerStorage)); | 533 SkASSERT(sizeof(DeviceCM) <= sizeof(fDeviceCMStorage)); |
534 fMCRec->fLayer = (DeviceCM*)fBaseLayerStorage; | 534 fMCRec->fLayer = (DeviceCM*)fDeviceCMStorage; |
535 new (fBaseLayerStorage) DeviceCM(NULL, NULL, NULL, fConservativeRasterClip,
false); | 535 new (fDeviceCMStorage) DeviceCM(NULL, NULL, NULL, fConservativeRasterClip, f
alse); |
536 | 536 |
537 fMCRec->fTopLayer = fMCRec->fLayer; | 537 fMCRec->fTopLayer = fMCRec->fLayer; |
538 | 538 |
539 fSurfaceBase = NULL; | 539 fSurfaceBase = NULL; |
540 | 540 |
541 if (device) { | 541 if (device) { |
542 device->initForRootLayer(fProps.pixelGeometry()); | 542 device->initForRootLayer(fProps.pixelGeometry()); |
543 if (device->forceConservativeRasterClip()) { | 543 if (device->forceConservativeRasterClip()) { |
544 fConservativeRasterClip = true; | 544 fConservativeRasterClip = true; |
545 } | 545 } |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 if (layer) { | 1099 if (layer) { |
1100 if (layer->fNext) { | 1100 if (layer->fNext) { |
1101 const SkIPoint& origin = layer->fDevice->getOrigin(); | 1101 const SkIPoint& origin = layer->fDevice->getOrigin(); |
1102 this->internalDrawDevice(layer->fDevice, origin.x(), origin.y(), | 1102 this->internalDrawDevice(layer->fDevice, origin.x(), origin.y(), |
1103 layer->fPaint, layer->fDeviceIsBitmapDevice
); | 1103 layer->fPaint, layer->fDeviceIsBitmapDevice
); |
1104 // reset this, since internalDrawDevice will have set it to true | 1104 // reset this, since internalDrawDevice will have set it to true |
1105 fDeviceCMDirty = true; | 1105 fDeviceCMDirty = true; |
1106 SkDELETE(layer); | 1106 SkDELETE(layer); |
1107 } else { | 1107 } else { |
1108 // we're at the root | 1108 // we're at the root |
1109 SkASSERT(layer == (void*)fBaseLayerStorage); | 1109 SkASSERT(layer == (void*)fDeviceCMStorage); |
1110 layer->~DeviceCM(); | 1110 layer->~DeviceCM(); |
1111 } | 1111 } |
1112 } | 1112 } |
1113 } | 1113 } |
1114 | 1114 |
1115 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { | 1115 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { |
1116 if (NULL == props) { | 1116 if (NULL == props) { |
1117 props = &fProps; | 1117 props = &fProps; |
1118 } | 1118 } |
1119 return this->onNewSurface(info, *props); | 1119 return this->onNewSurface(info, *props); |
(...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2645 } | 2645 } |
2646 | 2646 |
2647 if (matrix) { | 2647 if (matrix) { |
2648 canvas->concat(*matrix); | 2648 canvas->concat(*matrix); |
2649 } | 2649 } |
2650 } | 2650 } |
2651 | 2651 |
2652 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 2652 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
2653 fCanvas->restoreToCount(fSaveCount); | 2653 fCanvas->restoreToCount(fSaveCount); |
2654 } | 2654 } |
OLD | NEW |