Index: include/gpu/GrColor.h |
diff --git a/include/gpu/GrColor.h b/include/gpu/GrColor.h |
index c53e4b219d3b9524171b576520631521975afcfe..4ab709b4f1c8763ddcbe62a69d0e9ce9f70ac63c 100644 |
--- a/include/gpu/GrColor.h |
+++ b/include/gpu/GrColor.h |
@@ -88,6 +88,11 @@ static inline void GrColorToRGBAFloat(GrColor color, float rgba[4]) { |
rgba[3] = GrColorUnpackA(color) * ONE_OVER_255; |
} |
+/** Determines whether the color is opaque or not. */ |
+static inline bool GrColorIsOpaque(GrColor color) { |
+ return (color & (0xFFU << GrColor_SHIFT_A)) == (0xFFU << GrColor_SHIFT_A); |
+} |
+ |
/** |
* Flags used for bitfields of color components. They are defined so that the bit order reflects the |
* GrColor shift order. |