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

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

Issue 2768143002: Back PaintRecord with PaintOpBuffer instead of SkPicture (Closed)
Patch Set: More unit tests Created 3 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
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 int src_y) override; 46 int src_y) override;
47 bool readPixels(SkBitmap* bitmap, int src_x, int src_y) override; 47 bool readPixels(SkBitmap* bitmap, int src_x, int src_y) override;
48 bool readPixels(const SkIRect& srcRect, SkBitmap* bitmap) override; 48 bool readPixels(const SkIRect& srcRect, SkBitmap* bitmap) override;
49 bool writePixels(const SkImageInfo& info, 49 bool writePixels(const SkImageInfo& info,
50 const void* pixels, 50 const void* pixels,
51 size_t row_bytes, 51 size_t row_bytes,
52 int x, 52 int x,
53 int y) override; 53 int y) override;
54 int save() override; 54 int save() override;
55 int saveLayer(const SkRect* bounds, const PaintFlags* flags) override; 55 int saveLayer(const SkRect* bounds, const PaintFlags* flags) override;
56 int saveLayerAlpha(const SkRect* bounds, U8CPU alpha) override; 56 int saveLayerAlpha(const SkRect* bounds, uint8_t alpha) override;
57 57
58 void restore() override; 58 void restore() override;
59 int getSaveCount() const override; 59 int getSaveCount() const override;
60 void restoreToCount(int save_count) override; 60 void restoreToCount(int save_count) override;
61 void translate(SkScalar dx, SkScalar dy) override; 61 void translate(SkScalar dx, SkScalar dy) override;
62 void scale(SkScalar sx, SkScalar sy) override; 62 void scale(SkScalar sx, SkScalar sy) override;
63 void rotate(SkScalar degrees) override; 63 void rotate(SkScalar degrees) override;
64 void concat(const SkMatrix& matrix) override; 64 void concat(const SkMatrix& matrix) override;
65 void setMatrix(const SkMatrix& matrix) override; 65 void setMatrix(const SkMatrix& matrix) override;
66 66
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 void drawPicture(sk_sp<const PaintRecord> record) override; 138 void drawPicture(sk_sp<const PaintRecord> record) override;
139 139
140 bool isClipEmpty() const override; 140 bool isClipEmpty() const override;
141 bool isClipRect() const override; 141 bool isClipRect() const override;
142 const SkMatrix& getTotalMatrix() const override; 142 const SkMatrix& getTotalMatrix() const override;
143 143
144 void temporary_internal_describeTopLayer(SkMatrix* matrix, 144 void temporary_internal_describeTopLayer(SkMatrix* matrix,
145 SkIRect* clip_bounds) override; 145 SkIRect* clip_bounds) override;
146 146
147 bool ToPixmap(SkPixmap* output) override; 147 bool ToPixmap(SkPixmap* output) override;
148 void AnnotateRectWithURL(const SkRect& rect, SkData* data) override; 148 void Annotate(AnnotationType type,
149 void AnnotateNamedDestination(const SkPoint& point, SkData* data) override; 149 const SkRect& rect,
150 void AnnotateLinkToDestination(const SkRect& rect, SkData* data) override; 150 sk_sp<SkData> data) override;
151 151
152 void PlaybackPaintRecord(sk_sp<const PaintRecord> record) override; 152 void PlaybackPaintRecord(sk_sp<const PaintRecord> record) override;
153 153
154 // Don't shadow non-virtual helper functions. 154 // Don't shadow non-virtual helper functions.
155 using PaintCanvas::clipRect; 155 using PaintCanvas::clipRect;
156 using PaintCanvas::clipRRect; 156 using PaintCanvas::clipRRect;
157 using PaintCanvas::clipPath; 157 using PaintCanvas::clipPath;
158 using PaintCanvas::drawBitmap; 158 using PaintCanvas::drawBitmap;
159 using PaintCanvas::drawColor; 159 using PaintCanvas::drawColor;
160 using PaintCanvas::drawImage; 160 using PaintCanvas::drawImage;
161 using PaintCanvas::drawPicture; 161 using PaintCanvas::drawPicture;
162 162
163 private: 163 private:
164 SkCanvas* canvas_; 164 SkCanvas* canvas_;
165 std::unique_ptr<SkCanvas> owned_; 165 std::unique_ptr<SkCanvas> owned_;
166 166
167 DISALLOW_COPY_AND_ASSIGN(SkiaPaintCanvas); 167 DISALLOW_COPY_AND_ASSIGN(SkiaPaintCanvas);
168 }; 168 };
169 169
170 } // namespace cc 170 } // namespace cc
171 171
172 #endif // CC_PAINT_SKIA_PAINT_CANVAS_H_ 172 #endif // CC_PAINT_SKIA_PAINT_CANVAS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698