• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2012 The Android Open Source Project
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 
8 #include "SkBitmapSource.h"
9 
SkBitmapSource(const SkBitmap & bitmap)10 SkBitmapSource::SkBitmapSource(const SkBitmap& bitmap)
11   : INHERITED(0),
12     fBitmap(bitmap) {
13 }
14 
SkBitmapSource(SkFlattenableReadBuffer & buffer)15 SkBitmapSource::SkBitmapSource(SkFlattenableReadBuffer& buffer)
16   : INHERITED(buffer) {
17     fBitmap.unflatten(buffer);
18 }
19 
flatten(SkFlattenableWriteBuffer & buffer) const20 void SkBitmapSource::flatten(SkFlattenableWriteBuffer& buffer) const {
21     this->INHERITED::flatten(buffer);
22     fBitmap.flatten(buffer);
23 }
24 
onFilterImage(Proxy *,const SkBitmap &,const SkMatrix &,SkBitmap * result,SkIPoint * offset)25 bool SkBitmapSource::onFilterImage(Proxy*, const SkBitmap&, const SkMatrix&,
26                                    SkBitmap* result, SkIPoint* offset) {
27     *result = fBitmap;
28     return true;
29 }
30