Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Side by Side Diff: skia/ext/analysis_canvas.h

Issue 12184010: skia::AnalysisCanvas: implementation for IsCheapInRect(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Wrote device boilerplate Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SKIA_EXT_ANALYSIS_CANVAS_H_
6 #define SKIA_EXT_ANALYSIS_CANVAS_H_
7
8 #include "third_party/skia/include/core/SkCanvas.h"
9 #include "third_party/skia/include/core/SkDevice.h"
10
11 namespace skia {
12
13 class SK_API AnalysisDevice : public SkDevice {
14 public:
15 AnalysisDevice(const SkBitmap& bm);
16 };
17
18 // Does not render anything, but gathers statistics about a region
19 // (specified as a clip rectangle) of an SkPicture as the picture is
20 // played back through it.
21 class SK_API AnalysisCanvas : public SkCanvas {
22 public:
23 AnalysisCanvas(SkDevice*, SkRect clip);
24 virtual ~AnalysisCanvas();
25
26 virtual int save(SkCanvas::SaveFlags = kMatrixClip_SaveFlag);
Justin Novosad 2013/02/04 22:08:04 SK_OVERRIDE on all the virtuals please!
Tom Hudson 2013/02/05 10:23:24 Done. However, as much as I love SK_OVERRIDE, thi
27 virtual int saveLayer(const SkRect*, const SkPaint*,
28 SkCanvas::SaveFlags = kARGB_ClipLayer_SaveFlag);
29 virtual void restore();
30 virtual bool clipRect(const SkRect&, SkRegion::Op, bool);
31 virtual bool clipRRect(const SkRRect&, SkRegion::Op, bool);
32 virtual bool clipPath(const SkPath&, SkRegion::Op, bool);
33 virtual bool clipRegion(const SkRegion&, SkRegion::Op);
34 virtual void clear(SkColor);
35 virtual void drawPaint(const SkPaint&);
36 virtual void drawPoints(PointMode, size_t, const SkPoint [], const SkPaint&);
37 virtual void drawRect(const SkRect&, const SkPaint&);
38 virtual void drawOval(const SkRect&, const SkPaint&);
39 virtual void drawRRect(const SkRRect&, const SkPaint&);
40 virtual void drawPath(const SkPath&, const SkPaint&);
41 virtual void drawBitmap(const SkBitmap&, SkScalar, SkScalar, const SkPaint&);
42 virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect*,
43 const SkRect&, const SkPaint* = NULL);
44 virtual void drawBitmapMatrix(const SkBitmap&, const SkMatrix&,
45 const SkPaint* = NULL);
46 virtual void drawBitmapNine(const SkBitmap&, const SkIRect&, const SkRect&,
47 const SkPaint* = NULL);
48 virtual void drawSprite(const SkBitmap&, int left, int top,
49 const SkPaint* = NULL);
50 virtual void drawText(const void*, size_t, SkScalar, SkScalar,
51 const SkPaint&);
52 virtual void drawPosText(const void*, size_t, const SkPoint [],
53 const SkPaint&);
54 virtual void drawPosTextH(const void*, size_t, const SkScalar [], SkScalar,
55 const SkPaint&);
56 virtual void drawTextOnPath(const void*, size_t, const SkPath&,
57 const SkMatrix*, const SkPaint&);
58 virtual void drawVertices(VertexMode, int, const SkPoint [],
59 const SkPoint [], const SkColor [], SkXfermode*,
60 const uint16_t [], int, const SkPaint&);
61 virtual void drawData(const void*, size_t);
62
63 // Returns the estimated cost of drawing, in arbitrary units.
64 int getEstimatedCost() const;
65
66 // Resets the clip and the cost estimate.
67 void reset(SkRect clip);
68
69 protected:
70
71 int estimatedCost_;
72 SkRect clip_;
73
74 };
75
76 } // namespace skia
77
78 #endif // SKIA_EXT_ANALYSIS_CANVAS_H_
79
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698