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

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

Issue 303373003: Add an OR operator overload for SaveFlags to avoid extra static casts. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: spacing Created 6 years, 6 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
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkMatrixClipStateMgr.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 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 |= 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
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 }
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkMatrixClipStateMgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698