forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbitmap.h
30 lines (22 loc) · 930 Bytes
/
bitmap.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2020 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.
#ifndef PDF_PPAPI_MIGRATION_BITMAP_H_
#define PDF_PPAPI_MIGRATION_BITMAP_H_
#include <memory>
class SkBitmap;
namespace pp {
class ImageData;
} // namespace pp
namespace chrome_pdf {
// Creates an SkBitmap from a pp::ImageData. The SkBitmap takes ownership of the
// pp::ImageData, and shares ownership of the underlying pixel memory. (Note
// that it's easy to make a shallow copy of a pp::ImageData.)
//
// In case of an error, returns an empty SkBitmap.
//
// TODO(kmoon): Skia is trying to get rid of SkBitmap in favor of immutable
// types like SkImage, so we should migrate once PDFium is ready for Skia.
SkBitmap SkBitmapFromPPImageData(std::unique_ptr<pp::ImageData> image_data);
} // namespace chrome_pdf
#endif // PDF_PPAPI_MIGRATION_BITMAP_H_