| 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" |
| 11 #include "SkDeviceImageFilterProxy.h" | 11 #include "SkDeviceImageFilterProxy.h" |
| 12 #include "SkDraw.h" | 12 #include "SkDraw.h" |
| 13 #include "SkDrawable.h" | 13 #include "SkDrawable.h" |
| 14 #include "SkDrawFilter.h" | 14 #include "SkDrawFilter.h" |
| 15 #include "SkDrawLooper.h" | 15 #include "SkDrawLooper.h" |
| 16 #include "SkErrorInternals.h" |
| 16 #include "SkImage.h" | 17 #include "SkImage.h" |
| 17 #include "SkMetaData.h" | 18 #include "SkMetaData.h" |
| 18 #include "SkPathOps.h" | 19 #include "SkPathOps.h" |
| 19 #include "SkPatchUtils.h" | 20 #include "SkPatchUtils.h" |
| 20 #include "SkPicture.h" | 21 #include "SkPicture.h" |
| 21 #include "SkRasterClip.h" | 22 #include "SkRasterClip.h" |
| 22 #include "SkReadPixelsRec.h" | 23 #include "SkReadPixelsRec.h" |
| 23 #include "SkRRect.h" | 24 #include "SkRRect.h" |
| 24 #include "SkSmallAllocator.h" | 25 #include "SkSmallAllocator.h" |
| 25 #include "SkSurface_Base.h" | 26 #include "SkSurface_Base.h" |
| (...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 return; | 941 return; |
| 941 } | 942 } |
| 942 | 943 |
| 943 SkBaseDevice::Usage usage = SkBaseDevice::kSaveLayer_Usage; | 944 SkBaseDevice::Usage usage = SkBaseDevice::kSaveLayer_Usage; |
| 944 if (paint && paint->getImageFilter()) { | 945 if (paint && paint->getImageFilter()) { |
| 945 usage = SkBaseDevice::kImageFilter_Usage; | 946 usage = SkBaseDevice::kImageFilter_Usage; |
| 946 } | 947 } |
| 947 device = device->onCreateCompatibleDevice(SkBaseDevice::CreateInfo(info, usa
ge, | 948 device = device->onCreateCompatibleDevice(SkBaseDevice::CreateInfo(info, usa
ge, |
| 948 fProps.pi
xelGeometry())); | 949 fProps.pi
xelGeometry())); |
| 949 if (NULL == device) { | 950 if (NULL == device) { |
| 950 SkDebugf("Unable to create device for layer."); | 951 SkErrorInternals::SetError( kInternalError_SkError, |
| 952 "Unable to create device for layer."); |
| 951 return; | 953 return; |
| 952 } | 954 } |
| 953 | 955 |
| 954 device->setOrigin(ir.fLeft, ir.fTop); | 956 device->setOrigin(ir.fLeft, ir.fTop); |
| 955 DeviceCM* layer = SkNEW_ARGS(DeviceCM, | 957 DeviceCM* layer = SkNEW_ARGS(DeviceCM, |
| 956 (device, ir.fLeft, ir.fTop, paint, this, fConse
rvativeRasterClip)); | 958 (device, ir.fLeft, ir.fTop, paint, this, fConse
rvativeRasterClip)); |
| 957 device->unref(); | 959 device->unref(); |
| 958 | 960 |
| 959 layer->fNext = fMCRec->fTopLayer; | 961 layer->fNext = fMCRec->fTopLayer; |
| 960 fMCRec->fLayer = layer; | 962 fMCRec->fLayer = layer; |
| (...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2511 } | 2513 } |
| 2512 | 2514 |
| 2513 if (matrix) { | 2515 if (matrix) { |
| 2514 canvas->concat(*matrix); | 2516 canvas->concat(*matrix); |
| 2515 } | 2517 } |
| 2516 } | 2518 } |
| 2517 | 2519 |
| 2518 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 2520 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
| 2519 fCanvas->restoreToCount(fSaveCount); | 2521 fCanvas->restoreToCount(fSaveCount); |
| 2520 } | 2522 } |
| OLD | NEW |