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

Side by Side Diff: include/core/SkCanvas.h

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 | « no previous file | src/core/SkCanvas.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 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 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 #ifndef SkCanvas_DEFINED 8 #ifndef SkCanvas_DEFINED
9 #define SkCanvas_DEFINED 9 #define SkCanvas_DEFINED
10 10
(...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 // the caller must respect the restrictions associated with peekPixels(). 1500 // the caller must respect the restrictions associated with peekPixels().
1501 bool asROBitmap(SkBitmap*) const; 1501 bool asROBitmap(SkBitmap*) const;
1502 1502
1503 private: 1503 private:
1504 SkBitmap fBitmap; // used if peekPixels() fails 1504 SkBitmap fBitmap; // used if peekPixels() fails
1505 const void* fAddr; // NULL on failure 1505 const void* fAddr; // NULL on failure
1506 SkImageInfo fInfo; 1506 SkImageInfo fInfo;
1507 size_t fRowBytes; 1507 size_t fRowBytes;
1508 }; 1508 };
1509 1509
1510 static inline SkCanvas::SaveFlags operator|(const SkCanvas::SaveFlags lhs,
1511 const SkCanvas::SaveFlags rhs) {
1512 return static_cast<SkCanvas::SaveFlags>(lhs | rhs);
1513 }
1514
1515 static inline SkCanvas::SaveFlags& operator|=(SkCanvas::SaveFlags& lhs,
1516 const SkCanvas::SaveFlags rhs) {
1517 lhs = lhs | rhs;
1518 return lhs;
1519 }
1520
1521
1510 #endif 1522 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698