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

Side by Side Diff: skia/ext/platform_canvas.h

Issue 1462163002: Move uncoupled code out of skia/ext/platform_device.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-draft-metadata
Patch Set: Trim superfluous SK_API Created 5 years 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 | « printing/printed_document.cc ('k') | skia/ext/platform_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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 SKIA_EXT_PLATFORM_CANVAS_H_ 5 #ifndef SKIA_EXT_PLATFORM_CANVAS_H_
6 #define SKIA_EXT_PLATFORM_CANVAS_H_ 6 #define SKIA_EXT_PLATFORM_CANVAS_H_
7 7
8 // The platform-specific device will include the necessary platform headers 8 // The platform-specific device will include the necessary platform headers
9 // to get the surface type. 9 // to get the surface type.
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "skia/ext/platform_device.h" 11 #include "skia/ext/platform_surface.h"
12 #include "skia/ext/refptr.h" 12 #include "skia/ext/refptr.h"
13 #include "third_party/skia/include/core/SkBitmap.h" 13 #include "third_party/skia/include/core/SkBitmap.h"
14 #include "third_party/skia/include/core/SkCanvas.h" 14 #include "third_party/skia/include/core/SkCanvas.h"
15 #include "third_party/skia/include/core/SkPixelRef.h" 15 #include "third_party/skia/include/core/SkPixelRef.h"
16 #include "third_party/skia/include/core/SkPixmap.h" 16 #include "third_party/skia/include/core/SkPixmap.h"
17 17
18 class SkBaseDevice;
19
18 namespace skia { 20 namespace skia {
19 21
20 typedef SkCanvas PlatformCanvas; 22 typedef SkCanvas PlatformCanvas;
21 23
22 // 24 //
23 // Note about error handling. 25 // Note about error handling.
24 // 26 //
25 // Creating a canvas can fail at times, most often because we fail to allocate 27 // Creating a canvas can fail at times, most often because we fail to allocate
26 // the backing-store (pixels). This can be from out-of-memory, or something 28 // the backing-store (pixels). This can be from out-of-memory, or something
27 // more opaque, like GDI or cairo reported a failure. 29 // more opaque, like GDI or cairo reported a failure.
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 PlatformSurface GetPlatformSurface() { return platform_surface_; } 166 PlatformSurface GetPlatformSurface() { return platform_surface_; }
165 private: 167 private:
166 SkCanvas* canvas_; 168 SkCanvas* canvas_;
167 PlatformSurface platform_surface_; 169 PlatformSurface platform_surface_;
168 170
169 // Disallow copy and assign 171 // Disallow copy and assign
170 ScopedPlatformPaint(const ScopedPlatformPaint&); 172 ScopedPlatformPaint(const ScopedPlatformPaint&);
171 ScopedPlatformPaint& operator=(const ScopedPlatformPaint&); 173 ScopedPlatformPaint& operator=(const ScopedPlatformPaint&);
172 }; 174 };
173 175
176 // Following routines are used in print preview workflow to mark the
177 // preview metafile.
178 SK_API SkMetaData& GetMetaData(const SkCanvas& canvas);
179
180 #if defined(OS_MACOSX)
181 SK_API void SetIsPreviewMetafile(const SkCanvas& canvas, bool is_preview);
182 SK_API bool IsPreviewMetafile(const SkCanvas& canvas);
183
184 // Returns the CGContext that backing the SkCanvas.
185 // Returns NULL if none is bound.
186 SK_API CGContextRef GetBitmapContext(const SkCanvas& canvas);
187 #endif
188
174 } // namespace skia 189 } // namespace skia
175 190
176 #endif // SKIA_EXT_PLATFORM_CANVAS_H_ 191 #endif // SKIA_EXT_PLATFORM_CANVAS_H_
OLDNEW
« no previous file with comments | « printing/printed_document.cc ('k') | skia/ext/platform_canvas.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698