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 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 } | 926 } |
927 | 927 |
928 bool isOpaque = !SkToBool(flags & kHasAlphaLayer_SaveFlag); | 928 bool isOpaque = !SkToBool(flags & kHasAlphaLayer_SaveFlag); |
929 SkImageInfo info = SkImageInfo::MakeN32(ir.width(), ir.height(), | 929 SkImageInfo info = SkImageInfo::MakeN32(ir.width(), ir.height(), |
930 isOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType); | 930 isOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType); |
931 | 931 |
932 SkBaseDevice* device; | 932 SkBaseDevice* device; |
933 if (paint && paint->getImageFilter()) { | 933 if (paint && paint->getImageFilter()) { |
934 device = this->getDevice(); | 934 device = this->getDevice(); |
935 if (device) { | 935 if (device) { |
936 device = device->createCompatibleDevice(info); | 936 device = device->createCompatibleDeviceForImageFilter(info); |
937 } | 937 } |
938 } else { | 938 } else { |
939 device = this->createLayerDevice(info); | 939 device = this->createLayerDevice(info); |
940 } | 940 } |
941 if (NULL == device) { | 941 if (NULL == device) { |
942 SkDebugf("Unable to create device for layer."); | 942 SkDebugf("Unable to create device for layer."); |
943 return count; | 943 return count; |
944 } | 944 } |
945 this->setupDevice(device); | 945 this->setupDevice(device); |
946 | 946 |
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2550 } | 2550 } |
2551 | 2551 |
2552 if (matrix) { | 2552 if (matrix) { |
2553 canvas->concat(*matrix); | 2553 canvas->concat(*matrix); |
2554 } | 2554 } |
2555 } | 2555 } |
2556 | 2556 |
2557 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 2557 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
2558 fCanvas->restoreToCount(fSaveCount); | 2558 fCanvas->restoreToCount(fSaveCount); |
2559 } | 2559 } |
OLD | NEW |