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

Side by Side Diff: skia/public/interfaces/bitmap_skbitmap_struct_traits.h

Issue 2823003002: SkBitmap and SkPixelRef no longer need lock/unlock (Closed)
Patch Set: win fix after rebase 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_PUBLIC_INTERFACES_BITMAP_SKBITMAP_STRUCT_TRAITS_H_ 5 #ifndef SKIA_PUBLIC_INTERFACES_BITMAP_SKBITMAP_STRUCT_TRAITS_H_
6 #define SKIA_PUBLIC_INTERFACES_BITMAP_SKBITMAP_STRUCT_TRAITS_H_ 6 #define SKIA_PUBLIC_INTERFACES_BITMAP_SKBITMAP_STRUCT_TRAITS_H_
7 7
8 #include "mojo/public/cpp/bindings/array_traits.h" 8 #include "mojo/public/cpp/bindings/array_traits.h"
9 #include "skia/public/interfaces/bitmap.mojom.h" 9 #include "skia/public/interfaces/bitmap.mojom.h"
10 #include "third_party/skia/include/core/SkBitmap.h" 10 #include "third_party/skia/include/core/SkBitmap.h"
11 11
12 namespace mojo { 12 namespace mojo {
13 13
14 // A buffer used to read pixel data directly from BitmapDataView to SkBitmap. 14 // A buffer used to read pixel data directly from BitmapDataView to SkBitmap.
15 using BitmapBuffer = CArray<uint8_t>; 15 using BitmapBuffer = CArray<uint8_t>;
16 16
17 // Struct traits to use SkBitmap for skia::mojom::Bitmap in Chrome C++ code. 17 // Struct traits to use SkBitmap for skia::mojom::Bitmap in Chrome C++ code.
18 template <> 18 template <>
19 struct StructTraits<skia::mojom::BitmapDataView, SkBitmap> { 19 struct StructTraits<skia::mojom::BitmapDataView, SkBitmap> {
20 static bool IsNull(const SkBitmap& b); 20 static bool IsNull(const SkBitmap& b);
21 static void SetToNull(SkBitmap* b); 21 static void SetToNull(SkBitmap* b);
22 static skia::mojom::ColorType color_type(const SkBitmap& b); 22 static skia::mojom::ColorType color_type(const SkBitmap& b);
23 static skia::mojom::AlphaType alpha_type(const SkBitmap& b); 23 static skia::mojom::AlphaType alpha_type(const SkBitmap& b);
24 static skia::mojom::ColorProfileType profile_type(const SkBitmap& b); 24 static skia::mojom::ColorProfileType profile_type(const SkBitmap& b);
25 static uint32_t width(const SkBitmap& b); 25 static uint32_t width(const SkBitmap& b);
26 static uint32_t height(const SkBitmap& b); 26 static uint32_t height(const SkBitmap& b);
27 static uint64_t row_bytes(const SkBitmap& b); 27 static uint64_t row_bytes(const SkBitmap& b);
28 static BitmapBuffer pixel_data(const SkBitmap& b); 28 static BitmapBuffer pixel_data(const SkBitmap& b);
29 static bool Read(skia::mojom::BitmapDataView data, SkBitmap* b); 29 static bool Read(skia::mojom::BitmapDataView data, SkBitmap* b);
30 static void* SetUpContext(const SkBitmap& b);
31 static void TearDownContext(const SkBitmap& b, void* context);
32 }; 30 };
33 31
34 } // namespace mojo 32 } // namespace mojo
35 33
36 #endif // SKIA_PUBLIC_INTERFACES_BITMAP_SKBITMAP_STRUCT_TRAITS_H_ 34 #endif // SKIA_PUBLIC_INTERFACES_BITMAP_SKBITMAP_STRUCT_TRAITS_H_
OLDNEW
« no previous file with comments | « skia/ext/platform_canvas_unittest.cc ('k') | skia/public/interfaces/bitmap_skbitmap_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698