xref: /aosp_15_r20/external/skia/src/codec/SkBmpBaseCodec.cpp (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1 /*
2  * Copyright 2017 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 #include "src/codec/SkBmpBaseCodec.h"
8 
9 #include "include/core/SkStream.h"
10 #include "include/private/SkEncodedInfo.h"
11 #include "include/private/base/SkMalloc.h"
12 
13 #include <utility>
14 
~SkBmpBaseCodec()15 SkBmpBaseCodec::~SkBmpBaseCodec() {}
16 
SkBmpBaseCodec(SkEncodedInfo && info,std::unique_ptr<SkStream> stream,uint16_t bitsPerPixel,SkCodec::SkScanlineOrder rowOrder)17 SkBmpBaseCodec::SkBmpBaseCodec(SkEncodedInfo&& info, std::unique_ptr<SkStream> stream,
18                                uint16_t bitsPerPixel, SkCodec::SkScanlineOrder rowOrder)
19     : INHERITED(std::move(info), std::move(stream), bitsPerPixel, rowOrder)
20     , fSrcBuffer(sk_malloc_canfail(this->srcRowBytes()))
21 {}
22