diff --git a/gfx/layers/Layers.h b/gfx/layers/Layers.h index 54c7cfbbc06..2e8c1e4f175 100644 --- a/gfx/layers/Layers.h +++ b/gfx/layers/Layers.h @@ -631,6 +631,20 @@ public: // quality. PRBool CanUseOpaqueSurface(); + enum SurfaceMode { + SURFACE_OPAQUE, + SURFACE_SINGLE_CHANNEL_ALPHA, + SURFACE_COMPONENT_ALPHA + }; + SurfaceMode GetSurfaceMode() + { + if (CanUseOpaqueSurface()) + return SURFACE_OPAQUE; + if (mContentFlags & CONTENT_COMPONENT_ALPHA) + return SURFACE_COMPONENT_ALPHA; + return SURFACE_SINGLE_CHANNEL_ALPHA; + } + /** * This setter can be used anytime. The user data for all keys is * initially null. Ownership pases to the layer manager.