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

Side by Side Diff: src/core/SkBBoxRecord.h

Issue 243853006: make drawText calls non-virtual, to ease SkFont and TextBlob (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: update SkRecord, don't infinitely recurse in SkBBoxRecord Created 6 years, 8 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
« no previous file with comments | « include/utils/SkProxyCanvas.h ('k') | src/core/SkBBoxRecord.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #ifndef SkBBoxRecord_DEFINED 9 #ifndef SkBBoxRecord_DEFINED
10 #define SkBBoxRecord_DEFINED 10 #define SkBBoxRecord_DEFINED
(...skipping 18 matching lines...) Expand all
29 virtual void handleBBox(const SkRect& bbox) = 0; 29 virtual void handleBBox(const SkRect& bbox) = 0;
30 30
31 virtual void drawOval(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE; 31 virtual void drawOval(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE;
32 virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) SK_OVERRI DE; 32 virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) SK_OVERRI DE;
33 virtual void drawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE; 33 virtual void drawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE;
34 virtual void drawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE; 34 virtual void drawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
35 virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[], 35 virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
36 const SkPaint& paint) SK_OVERRIDE; 36 const SkPaint& paint) SK_OVERRIDE;
37 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; 37 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
38 virtual void clear(SkColor) SK_OVERRIDE; 38 virtual void clear(SkColor) SK_OVERRIDE;
39 virtual void drawText(const void* text, size_t byteLength, SkScalar x, SkSca lar y,
40 const SkPaint& paint) SK_OVERRIDE;
41 virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, 39 virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
42 const SkPaint* paint = NULL) SK_OVERRIDE; 40 const SkPaint* paint = NULL) SK_OVERRIDE;
43 virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, 41 virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
44 const SkRect& dst, const SkPaint* paint, 42 const SkRect& dst, const SkPaint* paint,
45 DrawBitmapRectFlags flags) SK_OVERRIDE; 43 DrawBitmapRectFlags flags) SK_OVERRIDE;
46 virtual void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& mat, 44 virtual void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& mat,
47 const SkPaint* paint) SK_OVERRIDE; 45 const SkPaint* paint) SK_OVERRIDE;
48 virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, 46 virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
49 const SkRect& dst, const SkPaint* paint) SK_OVER RIDE; 47 const SkRect& dst, const SkPaint* paint) SK_OVER RIDE;
50 virtual void drawPosText(const void* text, size_t byteLength,
51 const SkPoint pos[], const SkPaint& paint) SK_OVERR IDE;
52 virtual void drawPosTextH(const void* text, size_t byteLength,
53 const SkScalar xpos[], SkScalar constY,
54 const SkPaint& paint) SK_OVERRIDE;
55 virtual void drawSprite(const SkBitmap& bitmap, int left, int top, 48 virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
56 const SkPaint* paint) SK_OVERRIDE; 49 const SkPaint* paint) SK_OVERRIDE;
57 virtual void drawTextOnPath(const void* text, size_t byteLength,
58 const SkPath& path, const SkMatrix* matrix,
59 const SkPaint& paint) SK_OVERRIDE;
60 virtual void drawVertices(VertexMode mode, int vertexCount, 50 virtual void drawVertices(VertexMode mode, int vertexCount,
61 const SkPoint vertices[], const SkPoint texs[], 51 const SkPoint vertices[], const SkPoint texs[],
62 const SkColor colors[], SkXfermode* xfer, 52 const SkColor colors[], SkXfermode* xfer,
63 const uint16_t indices[], int indexCount, 53 const uint16_t indices[], int indexCount,
64 const SkPaint& paint) SK_OVERRIDE; 54 const SkPaint& paint) SK_OVERRIDE;
65 virtual void drawPicture(SkPicture& picture) SK_OVERRIDE; 55 virtual void drawPicture(SkPicture& picture) SK_OVERRIDE;
66 56
67 protected: 57 protected:
68 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK _OVERRIDE; 58 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK _OVERRIDE;
59 virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkS calar y,
60 const SkPaint&) SK_OVERRIDE;
61 virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoin t pos[],
62 const SkPaint&) SK_OVERRIDE;
63 virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkSca lar xpos[],
64 SkScalar constY, const SkPaint&) SK_OVERRIDE;
65 virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkP ath& path,
66 const SkMatrix* matrix, const SkPaint&) SK_OVE RRIDE;
69 67
70 private: 68 private:
71 /** 69 /**
72 * Takes a bounding box in current canvas view space, accounts for stroking and effects, and 70 * Takes a bounding box in current canvas view space, accounts for stroking and effects, and
73 * computes an axis-aligned bounding box in device coordinates, then passes it to handleBBox() 71 * computes an axis-aligned bounding box in device coordinates, then passes it to handleBBox()
74 * returns false if the draw is completely clipped out, and may safely be ig nored. 72 * returns false if the draw is completely clipped out, and may safely be ig nored.
75 **/ 73 **/
76 bool transformBounds(const SkRect& bounds, const SkPaint* paint); 74 bool transformBounds(const SkRect& bounds, const SkPaint* paint);
77 75
78 typedef SkPictureRecord INHERITED; 76 typedef SkPictureRecord INHERITED;
79 }; 77 };
80 78
81 #endif 79 #endif
OLDNEW
« no previous file with comments | « include/utils/SkProxyCanvas.h ('k') | src/core/SkBBoxRecord.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698