1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/src/gpu/GrOvalRenderer.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,57 @@ 1.4 +/* 1.5 + * Copyright 2013 Google Inc. 1.6 + * 1.7 + * Use of this source code is governed by a BSD-style license that can be 1.8 + * found in the LICENSE file. 1.9 + */ 1.10 + 1.11 +#ifndef GrOvalRenderer_DEFINED 1.12 +#define GrOvalRenderer_DEFINED 1.13 + 1.14 +#include "GrContext.h" 1.15 +#include "GrPaint.h" 1.16 + 1.17 +class GrContext; 1.18 +class GrDrawTarget; 1.19 +class GrPaint; 1.20 +struct SkRect; 1.21 +class SkStrokeRec; 1.22 + 1.23 +/* 1.24 + * This class wraps helper functions that draw ovals and roundrects (filled & stroked) 1.25 + */ 1.26 +class GrOvalRenderer : public SkRefCnt { 1.27 +public: 1.28 + SK_DECLARE_INST_COUNT(GrOvalRenderer) 1.29 + 1.30 + GrOvalRenderer() : fRRectIndexBuffer(NULL) {} 1.31 + ~GrOvalRenderer() { 1.32 + this->reset(); 1.33 + } 1.34 + 1.35 + void reset(); 1.36 + 1.37 + bool drawOval(GrDrawTarget* target, const GrContext* context, bool useAA, 1.38 + const SkRect& oval, const SkStrokeRec& stroke); 1.39 + bool drawSimpleRRect(GrDrawTarget* target, GrContext* context, bool useAA, 1.40 + const SkRRect& rrect, const SkStrokeRec& stroke); 1.41 + 1.42 +private: 1.43 + bool drawEllipse(GrDrawTarget* target, bool useCoverageAA, 1.44 + const SkRect& ellipse, 1.45 + const SkStrokeRec& stroke); 1.46 + bool drawDIEllipse(GrDrawTarget* target, bool useCoverageAA, 1.47 + const SkRect& ellipse, 1.48 + const SkStrokeRec& stroke); 1.49 + void drawCircle(GrDrawTarget* target, bool useCoverageAA, 1.50 + const SkRect& circle, 1.51 + const SkStrokeRec& stroke); 1.52 + 1.53 + GrIndexBuffer* rRectIndexBuffer(GrGpu* gpu); 1.54 + 1.55 + GrIndexBuffer* fRRectIndexBuffer; 1.56 + 1.57 + typedef SkRefCnt INHERITED; 1.58 +}; 1.59 + 1.60 +#endif // GrOvalRenderer_DEFINED