| 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 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 | 906 |
| 907 static SkBaseDevice* create_compatible_device(SkCanvas* canvas, | 907 static SkBaseDevice* create_compatible_device(SkCanvas* canvas, |
| 908 const SkImageInfo& info) { | 908 const SkImageInfo& info) { |
| 909 SkBaseDevice* device = canvas->getDevice(); | 909 SkBaseDevice* device = canvas->getDevice(); |
| 910 return device ? device->createCompatibleDevice(info) : NULL; | 910 return device ? device->createCompatibleDevice(info) : NULL; |
| 911 } | 911 } |
| 912 | 912 |
| 913 int SkCanvas::internalSaveLayer(const SkRect* bounds, const SkPaint* paint, Save
Flags flags, | 913 int SkCanvas::internalSaveLayer(const SkRect* bounds, const SkPaint* paint, Save
Flags flags, |
| 914 bool justForImageFilter, SaveLayerStrategy strat
egy) { | 914 bool justForImageFilter, SaveLayerStrategy strat
egy) { |
| 915 #ifndef SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG | 915 #ifndef SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG |
| 916 flags = (SaveFlags)(flags | kClipToLayer_SaveFlag); | 916 flags = flags | kClipToLayer_SaveFlag; |
| 917 #endif | 917 #endif |
| 918 | 918 |
| 919 // do this before we create the layer. We don't call the public save() since | 919 // do this before we create the layer. We don't call the public save() since |
| 920 // that would invoke a possibly overridden virtual | 920 // that would invoke a possibly overridden virtual |
| 921 int count = this->internalSave(flags); | 921 int count = this->internalSave(flags); |
| 922 | 922 |
| 923 fDeviceCMDirty = true; | 923 fDeviceCMDirty = true; |
| 924 | 924 |
| 925 SkIRect ir; | 925 SkIRect ir; |
| 926 if (!this->clipRectBounds(bounds, flags, &ir, paint ? paint->getImageFilter(
) : NULL)) { | 926 if (!this->clipRectBounds(bounds, flags, &ir, paint ? paint->getImageFilter(
) : NULL)) { |
| (...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2627 if (!supported_for_raster_canvas(info)) { | 2627 if (!supported_for_raster_canvas(info)) { |
| 2628 return NULL; | 2628 return NULL; |
| 2629 } | 2629 } |
| 2630 | 2630 |
| 2631 SkBitmap bitmap; | 2631 SkBitmap bitmap; |
| 2632 if (!bitmap.installPixels(info, pixels, rowBytes)) { | 2632 if (!bitmap.installPixels(info, pixels, rowBytes)) { |
| 2633 return NULL; | 2633 return NULL; |
| 2634 } | 2634 } |
| 2635 return SkNEW_ARGS(SkCanvas, (bitmap)); | 2635 return SkNEW_ARGS(SkCanvas, (bitmap)); |
| 2636 } | 2636 } |
| OLD | NEW |