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

Side by Side Diff: src/core/SkValidation.h

Issue 23021015: Initial error handling code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Adding validation helper file Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SkValidation_DEFINED
reed1 2013/09/04 18:49:36 SkValidationUtils.h might be a more similar naming
sugoi1 2013/09/04 20:14:52 Done.
9 #define SkValidation_DEFINED
10
11 #include "SkBitmap.h"
12 #include "SkXfermode.h"
13
14 /** Returns true if coeff's value is in the SkXfermode::Coeff enum.
15 */
16 static inline bool IsValidCoeff(SkXfermode::Coeff coeff) {
17 return coeff >= 0 && coeff < SkXfermode::kCoeffCount;
18 }
19
20 /** Returns true if mode's value is in the SkXfermode::Mode enum.
21 */
22 static inline bool IsValidMode(SkXfermode::Mode mode) {
23 return (mode >= 0) && (mode <= SkXfermode::kLastMode);
24 }
25
26 /** Returns true if config's value is in the SkBitmap::Config enum.
27 */
28 static inline bool IsValidConfig(SkBitmap::Config config) {
29 return (config >= 0) && (config <= SkBitmap::kLastConfig);
30 }
31
32 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698