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

Unified Diff: components/arc/bitmap/bitmap_type_converters.cc

Issue 2308663002: Migrate ArcBitmap to use typemapping (Closed)
Patch Set: Addressed comment Created 4 years, 3 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
« no previous file with comments | « components/arc/bitmap/bitmap_type_converters.h ('k') | components/arc/common/bitmap.typemap » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/bitmap/bitmap_type_converters.cc
diff --git a/components/arc/bitmap/bitmap_type_converters.cc b/components/arc/bitmap/bitmap_type_converters.cc
deleted file mode 100644
index ab9e58b3bf27554a3156320ac6b528b84fde7b49..0000000000000000000000000000000000000000
--- a/components/arc/bitmap/bitmap_type_converters.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/arc/bitmap/bitmap_type_converters.h"
-
-namespace mojo {
-
-SkBitmap TypeConverter<SkBitmap, arc::mojom::ArcBitmapPtr>::Convert(
- const arc::mojom::ArcBitmapPtr& arcBitmap) {
- if (arcBitmap.is_null())
- return SkBitmap();
-
- SkImageInfo info = SkImageInfo::Make(
- arcBitmap->width, arcBitmap->height,
- kRGBA_8888_SkColorType, kPremul_SkAlphaType);
- if (info.getSafeSize(info.minRowBytes()) > arcBitmap->pixel_data.size())
- return SkBitmap();
-
- // Create the SkBitmap object which wraps the arc bitmap pixels.
- SkBitmap bitmap;
- if (!bitmap.installPixels(info,
- const_cast<uint8_t*>(arcBitmap->pixel_data.storage().data()),
- info.minRowBytes())) {
- return SkBitmap();
- }
-
- // Copy the pixels with converting color type.
- SkBitmap nativeColorBitmap;
- if (!bitmap.copyTo(&nativeColorBitmap, kN32_SkColorType))
- return SkBitmap();
-
- return nativeColorBitmap;
-}
-
-} // namespace mojo
« no previous file with comments | « components/arc/bitmap/bitmap_type_converters.h ('k') | components/arc/common/bitmap.typemap » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698