Bug 1092351 - Mark most of nsCSSBorderRenderer as private to make it easier to reason about and refactor. r=dholbert

This commit is contained in:
Jonathan Watt 2014-11-03 10:03:14 +00:00
parent f3de49f29d
commit e031ed5462

View File

@ -8,6 +8,7 @@
#define NS_CSS_RENDERING_BORDERS_H
#include "gfxRect.h"
#include "mozilla/Attributes.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/PathHelpers.h"
#include "mozilla/RefPtr.h"
@ -75,7 +76,8 @@ typedef enum {
BorderColorStyleDark
} BorderColorStyle;
struct nsCSSBorderRenderer {
class nsCSSBorderRenderer MOZ_FINAL
{
typedef mozilla::gfx::ColorPattern ColorPattern;
typedef mozilla::gfx::DrawTarget DrawTarget;
typedef mozilla::gfx::Float Float;
@ -83,6 +85,8 @@ struct nsCSSBorderRenderer {
typedef mozilla::gfx::Rect Rect;
typedef mozilla::gfx::RectCornerRadii RectCornerRadii;
public:
nsCSSBorderRenderer(gfxContext* aDestContext,
Rect& aOuterRect,
const uint8_t* aBorderStyles,
@ -92,6 +96,24 @@ struct nsCSSBorderRenderer {
nsBorderColors* const* aCompositeColors,
nscolor aBackgroundColor);
// draw the entire border
void DrawBorders();
// utility function used for background painting as well as borders
static void ComputeInnerRadii(const RectCornerRadii& aRadii,
const Float* aBorderSizes,
RectCornerRadii* aInnerRadiiRet);
// Given aRadii as the border radii for a rectangle, compute the
// appropriate radii for another rectangle *outside* that rectangle
// by increasing the radii, except keeping sharp corners sharp.
// Used for spread box-shadows
static void ComputeOuterRadii(const RectCornerRadii& aRadii,
const Float* aBorderSizes,
RectCornerRadii* aOuterRadiiRet);
private:
RectCornerRadii mBorderCornerDimensions;
// destination context
@ -208,22 +230,6 @@ struct nsCSSBorderRenderer {
// Draw a solid border that has no border radius (i.e. is rectangular) and
// uses CompositeColors.
void DrawRectangularCompositeColors();
// draw the entire border
void DrawBorders ();
// utility function used for background painting as well as borders
static void ComputeInnerRadii(const RectCornerRadii& aRadii,
const Float* aBorderSizes,
RectCornerRadii* aInnerRadiiRet);
// Given aRadii as the border radii for a rectangle, compute the
// appropriate radii for another rectangle *outside* that rectangle
// by increasing the radii, except keeping sharp corners sharp.
// Used for spread box-shadows
static void ComputeOuterRadii(const RectCornerRadii& aRadii,
const Float* aBorderSizes,
RectCornerRadii* aOuterRadiiRet);
};
namespace mozilla {