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

Unified Diff: skia/public/interfaces/bitmap_skbitmap_struct_traits.cc

Issue 2253293002: Mojo C++ bindings: change the first template parameter of StructTraits and UnionTraits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@91_extra
Patch Set: rebase Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: skia/public/interfaces/bitmap_skbitmap_struct_traits.cc
diff --git a/skia/public/interfaces/bitmap_skbitmap_struct_traits.cc b/skia/public/interfaces/bitmap_skbitmap_struct_traits.cc
index 5e6ce30bc61acf1b2a54608dd23a284abc0d0c12..ecd9707002f85530f399d2f0d2e2fc084243f308 100644
--- a/skia/public/interfaces/bitmap_skbitmap_struct_traits.cc
+++ b/skia/public/interfaces/bitmap_skbitmap_struct_traits.cc
@@ -107,52 +107,56 @@ skia::mojom::ColorProfileType SkColorSpaceToMojo(SkColorSpace* cs) {
} // namespace
// static
-bool StructTraits<skia::mojom::Bitmap, SkBitmap>::IsNull(const SkBitmap& b) {
+bool StructTraits<skia::mojom::BitmapDataView, SkBitmap>::IsNull(
+ const SkBitmap& b) {
return b.isNull();
}
// static
-void StructTraits<skia::mojom::Bitmap, SkBitmap>::SetToNull(SkBitmap* b) {
+void StructTraits<skia::mojom::BitmapDataView, SkBitmap>::SetToNull(
+ SkBitmap* b) {
b->reset();
}
// static
-skia::mojom::ColorType StructTraits<skia::mojom::Bitmap, SkBitmap>::color_type(
- const SkBitmap& b) {
+skia::mojom::ColorType StructTraits<skia::mojom::BitmapDataView,
+ SkBitmap>::color_type(const SkBitmap& b) {
return SkColorTypeToMojo(b.colorType());
}
// static
-skia::mojom::AlphaType StructTraits<skia::mojom::Bitmap, SkBitmap>::alpha_type(
- const SkBitmap& b) {
+skia::mojom::AlphaType StructTraits<skia::mojom::BitmapDataView,
+ SkBitmap>::alpha_type(const SkBitmap& b) {
return SkAlphaTypeToMojo(b.alphaType());
}
// static
skia::mojom::ColorProfileType
-StructTraits<skia::mojom::Bitmap, SkBitmap>::profile_type(const SkBitmap& b) {
+StructTraits<skia::mojom::BitmapDataView, SkBitmap>::profile_type(
+ const SkBitmap& b) {
return SkColorSpaceToMojo(b.colorSpace());
}
// static
-uint32_t StructTraits<skia::mojom::Bitmap, SkBitmap>::width(const SkBitmap& b) {
+uint32_t StructTraits<skia::mojom::BitmapDataView, SkBitmap>::width(
+ const SkBitmap& b) {
return b.width() < 0 ? 0 : static_cast<uint32_t>(b.width());
}
// static
-uint32_t StructTraits<skia::mojom::Bitmap, SkBitmap>::height(
+uint32_t StructTraits<skia::mojom::BitmapDataView, SkBitmap>::height(
const SkBitmap& b) {
return b.height() < 0 ? 0 : static_cast<uint32_t>(b.height());
}
// static
-BitmapBuffer StructTraits<skia::mojom::Bitmap, SkBitmap>::pixel_data(
+BitmapBuffer StructTraits<skia::mojom::BitmapDataView, SkBitmap>::pixel_data(
const SkBitmap& b) {
return {b.getSize(), b.getSize(), static_cast<uint8_t*>(b.getPixels())};
}
// static
-bool StructTraits<skia::mojom::Bitmap, SkBitmap>::Read(
+bool StructTraits<skia::mojom::BitmapDataView, SkBitmap>::Read(
skia::mojom::BitmapDataView data,
SkBitmap* b) {
// TODO: Ensure width and height are reasonable, eg. <= kMaxBitmapSize?
@@ -186,14 +190,14 @@ bool StructTraits<skia::mojom::Bitmap, SkBitmap>::Read(
}
// static
-void* StructTraits<skia::mojom::Bitmap, SkBitmap>::SetUpContext(
+void* StructTraits<skia::mojom::BitmapDataView, SkBitmap>::SetUpContext(
const SkBitmap& b) {
b.lockPixels();
return nullptr;
}
// static
-void StructTraits<skia::mojom::Bitmap, SkBitmap>::TearDownContext(
+void StructTraits<skia::mojom::BitmapDataView, SkBitmap>::TearDownContext(
const SkBitmap& b,
void* context) {
b.unlockPixels();
« no previous file with comments | « skia/public/interfaces/bitmap_skbitmap_struct_traits.h ('k') | skia/public/interfaces/image_filter_struct_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698