gfx/skia/trunk/src/gpu/GrOvalRenderer.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /*
michael@0 2 * Copyright 2013 Google Inc.
michael@0 3 *
michael@0 4 * Use of this source code is governed by a BSD-style license that can be
michael@0 5 * found in the LICENSE file.
michael@0 6 */
michael@0 7
michael@0 8 #ifndef GrOvalRenderer_DEFINED
michael@0 9 #define GrOvalRenderer_DEFINED
michael@0 10
michael@0 11 #include "GrContext.h"
michael@0 12 #include "GrPaint.h"
michael@0 13
michael@0 14 class GrContext;
michael@0 15 class GrDrawTarget;
michael@0 16 class GrPaint;
michael@0 17 struct SkRect;
michael@0 18 class SkStrokeRec;
michael@0 19
michael@0 20 /*
michael@0 21 * This class wraps helper functions that draw ovals and roundrects (filled & stroked)
michael@0 22 */
michael@0 23 class GrOvalRenderer : public SkRefCnt {
michael@0 24 public:
michael@0 25 SK_DECLARE_INST_COUNT(GrOvalRenderer)
michael@0 26
michael@0 27 GrOvalRenderer() : fRRectIndexBuffer(NULL) {}
michael@0 28 ~GrOvalRenderer() {
michael@0 29 this->reset();
michael@0 30 }
michael@0 31
michael@0 32 void reset();
michael@0 33
michael@0 34 bool drawOval(GrDrawTarget* target, const GrContext* context, bool useAA,
michael@0 35 const SkRect& oval, const SkStrokeRec& stroke);
michael@0 36 bool drawSimpleRRect(GrDrawTarget* target, GrContext* context, bool useAA,
michael@0 37 const SkRRect& rrect, const SkStrokeRec& stroke);
michael@0 38
michael@0 39 private:
michael@0 40 bool drawEllipse(GrDrawTarget* target, bool useCoverageAA,
michael@0 41 const SkRect& ellipse,
michael@0 42 const SkStrokeRec& stroke);
michael@0 43 bool drawDIEllipse(GrDrawTarget* target, bool useCoverageAA,
michael@0 44 const SkRect& ellipse,
michael@0 45 const SkStrokeRec& stroke);
michael@0 46 void drawCircle(GrDrawTarget* target, bool useCoverageAA,
michael@0 47 const SkRect& circle,
michael@0 48 const SkStrokeRec& stroke);
michael@0 49
michael@0 50 GrIndexBuffer* rRectIndexBuffer(GrGpu* gpu);
michael@0 51
michael@0 52 GrIndexBuffer* fRRectIndexBuffer;
michael@0 53
michael@0 54 typedef SkRefCnt INHERITED;
michael@0 55 };
michael@0 56
michael@0 57 #endif // GrOvalRenderer_DEFINED

mercurial