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

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

Issue 2686033005: Move metafile printing code from platform canvas to PaintCanvas (Closed)
Patch Set: Fix missing build_config include Created 3 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
« no previous file with comments | « no previous file | cc/paint/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_PAINT_CANVAS_H_ 5 #ifndef CC_PAINT_PAINT_CANVAS_H_
6 #define CC_PAINT_PAINT_CANVAS_H_ 6 #define CC_PAINT_PAINT_CANVAS_H_
7 7
8 #include "build/build_config.h"
8 #include "cc/paint/paint_export.h" 9 #include "cc/paint/paint_export.h"
9 #include "third_party/skia/include/core/SkCanvas.h" 10 #include "third_party/skia/include/core/SkCanvas.h"
10 #include "third_party/skia/include/utils/SkNWayCanvas.h" 11 #include "third_party/skia/include/utils/SkNWayCanvas.h"
11 #include "third_party/skia/include/utils/SkNoDrawCanvas.h" 12 #include "third_party/skia/include/utils/SkNoDrawCanvas.h"
12 13
13 namespace cc { 14 namespace cc {
14 15
15 using PaintCanvas = SkCanvas; 16 using PaintCanvas = SkCanvas;
16 using PaintCanvasNoDraw = SkNoDrawCanvas; 17 using PaintCanvasNoDraw = SkNoDrawCanvas;
17 using PaintCanvasAutoRestore = SkAutoCanvasRestore; 18 using PaintCanvasAutoRestore = SkAutoCanvasRestore;
18 19
19 class CC_PAINT_EXPORT PaintCanvasPassThrough : public SkNWayCanvas { 20 class CC_PAINT_EXPORT PaintCanvasPassThrough : public SkNWayCanvas {
20 public: 21 public:
21 explicit PaintCanvasPassThrough(SkCanvas* canvas); 22 explicit PaintCanvasPassThrough(SkCanvas* canvas);
22 PaintCanvasPassThrough(int width, int height); 23 PaintCanvasPassThrough(int width, int height);
23 ~PaintCanvasPassThrough() override; 24 ~PaintCanvasPassThrough() override;
24 }; 25 };
25 26
27 // TODO(enne): Move all these functions into PaintCanvas.
28
26 // PaintCanvas equivalent of skia::GetWritablePixels. 29 // PaintCanvas equivalent of skia::GetWritablePixels.
27 CC_PAINT_EXPORT bool ToPixmap(PaintCanvas* canvas, SkPixmap* output); 30 CC_PAINT_EXPORT bool ToPixmap(PaintCanvas* canvas, SkPixmap* output);
28 31
32 // Following routines are used in print preview workflow to mark the
33 // preview metafile.
34 #if defined(OS_MACOSX)
35 CC_PAINT_EXPORT void SetIsPreviewMetafile(PaintCanvas* canvas, bool is_preview);
36 CC_PAINT_EXPORT bool IsPreviewMetafile(PaintCanvas* canvas);
37 #endif
38
29 } // namespace cc 39 } // namespace cc
30 40
31 #endif // CC_PAINT_PAINT_CANVAS_H_ 41 #endif // CC_PAINT_PAINT_CANVAS_H_
OLDNEW
« no previous file with comments | « no previous file | cc/paint/paint_canvas.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698