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

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

Issue 2758413002: cc/paint: Remove PaintCanvas::peekPixels. (Closed)
Patch Set: update 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
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 10 matching lines...) Expand all
21 class PaintFlags; 21 class PaintFlags;
22 22
23 // A PaintCanvas derived class that passes PaintCanvas APIs through to 23 // A PaintCanvas derived class that passes PaintCanvas APIs through to
24 // an SkCanvas. This is more efficient than recording to a PaintRecord 24 // an SkCanvas. This is more efficient than recording to a PaintRecord
25 // and then playing back to an SkCanvas. 25 // and then playing back to an SkCanvas.
26 class CC_PAINT_EXPORT SkiaPaintCanvas final : public PaintCanvas { 26 class CC_PAINT_EXPORT SkiaPaintCanvas final : public PaintCanvas {
27 public: 27 public:
28 explicit SkiaPaintCanvas(SkCanvas* canvas); 28 explicit SkiaPaintCanvas(SkCanvas* canvas);
29 explicit SkiaPaintCanvas(const SkBitmap& bitmap); 29 explicit SkiaPaintCanvas(const SkBitmap& bitmap);
30 explicit SkiaPaintCanvas(const SkBitmap& bitmap, const SkSurfaceProps& props); 30 explicit SkiaPaintCanvas(const SkBitmap& bitmap, const SkSurfaceProps& props);
31 explicit SkiaPaintCanvas(SkiaPaintCanvas&& other);
31 ~SkiaPaintCanvas() override; 32 ~SkiaPaintCanvas() override;
32 33
34 SkiaPaintCanvas& operator=(SkiaPaintCanvas&& other) = default;
35
33 SkMetaData& getMetaData() override; 36 SkMetaData& getMetaData() override;
34 SkImageInfo imageInfo() const override; 37 SkImageInfo imageInfo() const override;
35 38
36 void flush() override; 39 void flush() override;
37 40
38 SkISize getBaseLayerSize() const override; 41 SkISize getBaseLayerSize() const override;
39 bool peekPixels(SkPixmap* pixmap) override;
40 bool readPixels(const SkImageInfo& dest_info, 42 bool readPixels(const SkImageInfo& dest_info,
41 void* dest_pixels, 43 void* dest_pixels,
42 size_t dest_row_bytes, 44 size_t dest_row_bytes,
43 int src_x, 45 int src_x,
44 int src_y) override; 46 int src_y) override;
45 bool readPixels(SkBitmap* bitmap, int src_x, int src_y) override; 47 bool readPixels(SkBitmap* bitmap, int src_x, int src_y) override;
46 bool readPixels(const SkIRect& srcRect, SkBitmap* bitmap) override; 48 bool readPixels(const SkIRect& srcRect, SkBitmap* bitmap) override;
47 bool writePixels(const SkImageInfo& info, 49 bool writePixels(const SkImageInfo& info,
48 const void* pixels, 50 const void* pixels,
49 size_t row_bytes, 51 size_t row_bytes,
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 using PaintCanvas::clipRRect; 158 using PaintCanvas::clipRRect;
157 using PaintCanvas::clipPath; 159 using PaintCanvas::clipPath;
158 using PaintCanvas::drawBitmap; 160 using PaintCanvas::drawBitmap;
159 using PaintCanvas::drawColor; 161 using PaintCanvas::drawColor;
160 using PaintCanvas::drawImage; 162 using PaintCanvas::drawImage;
161 using PaintCanvas::drawPicture; 163 using PaintCanvas::drawPicture;
162 164
163 private: 165 private:
164 SkCanvas* canvas_; 166 SkCanvas* canvas_;
165 std::unique_ptr<SkCanvas> owned_; 167 std::unique_ptr<SkCanvas> owned_;
168
169 DISALLOW_COPY_AND_ASSIGN(SkiaPaintCanvas);
166 }; 170 };
167 171
168 } // namespace cc 172 } // namespace cc
169 173
170 #endif // CC_PAINT_SKIA_PAINT_CANVAS_H_ 174 #endif // CC_PAINT_SKIA_PAINT_CANVAS_H_
OLDNEW
« no previous file with comments | « cc/paint/paint_canvas.h ('k') | cc/paint/skia_paint_canvas.cc » ('j') | ui/gfx/canvas.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698