Add an OR operator overload for SaveFlags to avoid extra static casts.
R=reed@google.com Author: djsollen@google.com Review URL: https://codereview.chromium.org/303373003 git-svn-id: http://skia.googlecode.com/svn/trunk@15005 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
999cfd1076
commit
2a5cd60bff
@ -1512,4 +1512,16 @@ private:
|
||||
size_t fRowBytes;
|
||||
};
|
||||
|
||||
static inline SkCanvas::SaveFlags operator|(const SkCanvas::SaveFlags lhs,
|
||||
const SkCanvas::SaveFlags rhs) {
|
||||
return static_cast<SkCanvas::SaveFlags>(lhs | rhs);
|
||||
}
|
||||
|
||||
static inline SkCanvas::SaveFlags& operator|=(SkCanvas::SaveFlags& lhs,
|
||||
const SkCanvas::SaveFlags rhs) {
|
||||
lhs = lhs | rhs;
|
||||
return lhs;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -913,7 +913,7 @@ static SkBaseDevice* create_compatible_device(SkCanvas* canvas,
|
||||
int SkCanvas::internalSaveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags flags,
|
||||
bool justForImageFilter, SaveLayerStrategy strategy) {
|
||||
#ifndef SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
|
||||
flags = (SaveFlags)(flags | kClipToLayer_SaveFlag);
|
||||
flags |= kClipToLayer_SaveFlag;
|
||||
#endif
|
||||
|
||||
// do this before we create the layer. We don't call the public save() since
|
||||
|
@ -172,8 +172,7 @@ int SkMatrixClipStateMgr::saveLayer(const SkRect* bounds, const SkPaint* paint,
|
||||
// restore
|
||||
fSkipOffsets = SkNEW(SkTDArray<int>);
|
||||
|
||||
fPicRecord->recordSaveLayer(bounds, paint,
|
||||
(SkCanvas::SaveFlags)(flags| SkCanvas::kMatrixClip_SaveFlag));
|
||||
fPicRecord->recordSaveLayer(bounds, paint, flags | SkCanvas::kMatrixClip_SaveFlag);
|
||||
#ifdef SK_DEBUG
|
||||
fActualDepth++;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user