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

Side by Side Diff: cc/paint/skia_paint_canvas.h

Issue 2743363006: Clean up cc/paint interfaces (Closed)
Patch Set: Fix PaintControllerTest v2 Created 3 years, 9 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
« no previous file with comments | « cc/paint/paint_surface.h ('k') | cc/paint/skia_paint_canvas.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_PAINT_SKIA_PAINT_CANVAS_H_ 5 #ifndef CC_PAINT_SKIA_PAINT_CANVAS_H_
6 #define CC_PAINT_SKIA_PAINT_CANVAS_H_ 6 #define CC_PAINT_SKIA_PAINT_CANVAS_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 int save() override; 52 int save() override;
53 int saveLayer(const SkRect* bounds, const PaintFlags* flags) override; 53 int saveLayer(const SkRect* bounds, const PaintFlags* flags) override;
54 int saveLayerAlpha(const SkRect* bounds, U8CPU alpha) override; 54 int saveLayerAlpha(const SkRect* bounds, U8CPU alpha) override;
55 55
56 void restore() override; 56 void restore() override;
57 int getSaveCount() const override; 57 int getSaveCount() const override;
58 void restoreToCount(int save_count) override; 58 void restoreToCount(int save_count) override;
59 void translate(SkScalar dx, SkScalar dy) override; 59 void translate(SkScalar dx, SkScalar dy) override;
60 void scale(SkScalar sx, SkScalar sy) override; 60 void scale(SkScalar sx, SkScalar sy) override;
61 void rotate(SkScalar degrees) override; 61 void rotate(SkScalar degrees) override;
62 void rotate(SkScalar degrees, SkScalar px, SkScalar py) override;
63 void concat(const SkMatrix& matrix) override; 62 void concat(const SkMatrix& matrix) override;
64 void setMatrix(const SkMatrix& matrix) override; 63 void setMatrix(const SkMatrix& matrix) override;
65 void resetMatrix() override;
66 64
67 void clipRect(const SkRect& rect, SkClipOp op, bool do_anti_alias) override; 65 void clipRect(const SkRect& rect, SkClipOp op, bool do_anti_alias) override;
68 void clipRRect(const SkRRect& rrect, 66 void clipRRect(const SkRRect& rrect,
69 SkClipOp op, 67 SkClipOp op,
70 bool do_anti_alias) override; 68 bool do_anti_alias) override;
71 void clipPath(const SkPath& path, SkClipOp op, bool do_anti_alias) override; 69 void clipPath(const SkPath& path, SkClipOp op, bool do_anti_alias) override;
72 bool quickReject(const SkRect& rect) const override; 70 bool quickReject(const SkRect& rect) const override;
73 bool quickReject(const SkPath& path) const override; 71 bool quickReject(const SkPath& path) const override;
74 SkRect getLocalClipBounds() const override; 72 SkRect getLocalClipBounds() const override;
75 bool getLocalClipBounds(SkRect* bounds) const override; 73 bool getLocalClipBounds(SkRect* bounds) const override;
(...skipping 21 matching lines...) Expand all
97 void drawArc(const SkRect& oval, 95 void drawArc(const SkRect& oval,
98 SkScalar start_angle, 96 SkScalar start_angle,
99 SkScalar sweep_angle, 97 SkScalar sweep_angle,
100 bool use_center, 98 bool use_center,
101 const PaintFlags& flags) override; 99 const PaintFlags& flags) override;
102 void drawRoundRect(const SkRect& rect, 100 void drawRoundRect(const SkRect& rect,
103 SkScalar rx, 101 SkScalar rx,
104 SkScalar ry, 102 SkScalar ry,
105 const PaintFlags& flags) override; 103 const PaintFlags& flags) override;
106 void drawPath(const SkPath& path, const PaintFlags& flags) override; 104 void drawPath(const SkPath& path, const PaintFlags& flags) override;
107 void drawImage(const SkImage* image, 105 void drawImage(sk_sp<const SkImage> image,
108 SkScalar left, 106 SkScalar left,
109 SkScalar top, 107 SkScalar top,
110 const PaintFlags* flags) override; 108 const PaintFlags* flags) override;
111 void drawImage(const sk_sp<SkImage>& image, 109 void drawImageRect(sk_sp<const SkImage> image,
112 SkScalar left,
113 SkScalar top,
114 const PaintFlags* flags) override;
115
116 void drawImageRect(const SkImage* image,
117 const SkRect& src, 110 const SkRect& src,
118 const SkRect& dst, 111 const SkRect& dst,
119 const PaintFlags* flags, 112 const PaintFlags* flags,
120 SrcRectConstraint constraint) override; 113 SrcRectConstraint constraint) override;
121 void drawBitmap(const SkBitmap& bitmap, 114 void drawBitmap(const SkBitmap& bitmap,
122 SkScalar left, 115 SkScalar left,
123 SkScalar top, 116 SkScalar top,
124 const PaintFlags* flags) override; 117 const PaintFlags* flags) override;
125 118
126 void drawText(const void* text, 119 void drawText(const void* text,
127 size_t byte_length, 120 size_t byte_length,
128 SkScalar x, 121 SkScalar x,
129 SkScalar y, 122 SkScalar y,
130 const PaintFlags& flags) override; 123 const PaintFlags& flags) override;
131 void drawPosText(const void* text, 124 void drawPosText(const void* text,
132 size_t byte_length, 125 size_t byte_length,
133 const SkPoint pos[], 126 const SkPoint pos[],
134 const PaintFlags& flags) override; 127 const PaintFlags& flags) override;
135 void drawTextBlob(const SkTextBlob* blob, 128 void drawTextBlob(sk_sp<SkTextBlob> blob,
136 SkScalar x,
137 SkScalar y,
138 const PaintFlags& flags) override;
139 void drawTextBlob(const sk_sp<SkTextBlob>& blob,
140 SkScalar x, 129 SkScalar x,
141 SkScalar y, 130 SkScalar y,
142 const PaintFlags& flags) override; 131 const PaintFlags& flags) override;
143 132
144 void drawPicture(const PaintRecord* record) override; 133 void drawPicture(sk_sp<const PaintRecord> record,
145 void drawPicture(const PaintRecord* record,
146 const SkMatrix* matrix, 134 const SkMatrix* matrix,
147 const PaintFlags* flags) override; 135 const PaintFlags* flags) override;
148 void drawPicture(sk_sp<PaintRecord> record) override;
149 136
150 bool isClipEmpty() const override; 137 bool isClipEmpty() const override;
151 bool isClipRect() const override; 138 bool isClipRect() const override;
152 const SkMatrix& getTotalMatrix() const override; 139 const SkMatrix& getTotalMatrix() const override;
153 140
154 void temporary_internal_describeTopLayer(SkMatrix* matrix, 141 void temporary_internal_describeTopLayer(SkMatrix* matrix,
155 SkIRect* clip_bounds) override; 142 SkIRect* clip_bounds) override;
156 143
157 bool ToPixmap(SkPixmap* output) override; 144 bool ToPixmap(SkPixmap* output) override;
158 void AnnotateRectWithURL(const SkRect& rect, SkData* data) override; 145 void AnnotateRectWithURL(const SkRect& rect, SkData* data) override;
159 void AnnotateNamedDestination(const SkPoint& point, SkData* data) override; 146 void AnnotateNamedDestination(const SkPoint& point, SkData* data) override;
160 void AnnotateLinkToDestination(const SkRect& rect, SkData* data) override; 147 void AnnotateLinkToDestination(const SkRect& rect, SkData* data) override;
161 148
162 // Don't shadow non-virtual helper functions. 149 // Don't shadow non-virtual helper functions.
163 using PaintCanvas::clipRect; 150 using PaintCanvas::clipRect;
164 using PaintCanvas::clipRRect; 151 using PaintCanvas::clipRRect;
165 using PaintCanvas::clipPath; 152 using PaintCanvas::clipPath;
166 using PaintCanvas::drawBitmap; 153 using PaintCanvas::drawBitmap;
167 using PaintCanvas::drawColor; 154 using PaintCanvas::drawColor;
168 using PaintCanvas::drawImage; 155 using PaintCanvas::drawImage;
156 using PaintCanvas::drawPicture;
169 157
170 private: 158 private:
171 SkCanvas* canvas_; 159 SkCanvas* canvas_;
172 std::unique_ptr<SkCanvas> owned_; 160 std::unique_ptr<SkCanvas> owned_;
173 }; 161 };
174 162
175 } // namespace cc 163 } // namespace cc
176 164
177 #endif // CC_PAINT_SKIA_PAINT_CANVAS_H_ 165 #endif // CC_PAINT_SKIA_PAINT_CANVAS_H_
OLDNEW
« no previous file with comments | « cc/paint/paint_surface.h ('k') | cc/paint/skia_paint_canvas.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698