Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 uint8_t* data, | 82 uint8_t* data, |
| 83 OnFailureType failure_type); | 83 OnFailureType failure_type); |
| 84 #endif | 84 #endif |
| 85 | 85 |
| 86 static inline SkCanvas* CreatePlatformCanvas(int width, | 86 static inline SkCanvas* CreatePlatformCanvas(int width, |
| 87 int height, | 87 int height, |
| 88 bool is_opaque) { | 88 bool is_opaque) { |
| 89 return CreatePlatformCanvas(width, height, is_opaque, 0, CRASH_ON_FAILURE); | 89 return CreatePlatformCanvas(width, height, is_opaque, 0, CRASH_ON_FAILURE); |
| 90 } | 90 } |
| 91 | 91 |
| 92 SK_API SkCanvas* CreateCanvas(const sk_sp<SkBaseDevice>& device, | 92 SK_API SkCanvas* CreateCanvas(sk_sp<SkBaseDevice>& device, |
|
f(malita)
2016/04/21 15:45:47
const sk_sp<SkBaseDevice>&
(
We normally use eith
danakj
2016/04/21 23:37:21
If you're not going to ref the thing, take a T* in
tomhudson
2016/04/25 20:20:51
Done.
| |
| 93 OnFailureType failure_type); | 93 OnFailureType failure_type); |
| 94 | 94 |
| 95 static inline SkCanvas* CreateBitmapCanvas(int width, | 95 static inline SkCanvas* CreateBitmapCanvas(int width, |
| 96 int height, | 96 int height, |
| 97 bool is_opaque) { | 97 bool is_opaque) { |
| 98 return CreatePlatformCanvas(width, height, is_opaque, 0, CRASH_ON_FAILURE); | 98 return CreatePlatformCanvas(width, height, is_opaque, 0, CRASH_ON_FAILURE); |
| 99 } | 99 } |
| 100 | 100 |
| 101 static inline SkCanvas* TryCreateBitmapCanvas(int width, | 101 static inline SkCanvas* TryCreateBitmapCanvas(int width, |
| 102 int height, | 102 int height, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 SK_API bool IsPreviewMetafile(const SkCanvas& canvas); | 172 SK_API bool IsPreviewMetafile(const SkCanvas& canvas); |
| 173 | 173 |
| 174 // Returns the CGContext that backing the SkCanvas. | 174 // Returns the CGContext that backing the SkCanvas. |
| 175 // Returns NULL if none is bound. | 175 // Returns NULL if none is bound. |
| 176 SK_API CGContextRef GetBitmapContext(const SkCanvas& canvas); | 176 SK_API CGContextRef GetBitmapContext(const SkCanvas& canvas); |
| 177 #endif | 177 #endif |
| 178 | 178 |
| 179 } // namespace skia | 179 } // namespace skia |
| 180 | 180 |
| 181 #endif // SKIA_EXT_PLATFORM_CANVAS_H_ | 181 #endif // SKIA_EXT_PLATFORM_CANVAS_H_ |
| OLD | NEW |