Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (C) 2015 The Android Open Source Project | |
|
scroggo
2015/08/13 16:53:07
This is the wrong header. If this is new code in S
msarett
2015/08/13 18:10:23
You're right. BitmapRegionSampler needs the Andro
| |
| 3 * | |
| 4 * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 * you may not use this file except in compliance with the License. | |
| 6 * You may obtain a copy of the License at | |
| 7 * | |
| 8 * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 * | |
| 10 * Unless required by applicable law or agreed to in writing, software | |
| 11 * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 * See the License for the specific language governing permissions and | |
| 14 * limitations under the License. | |
| 15 */ | |
| 16 | |
| 17 #include "SkBitmap.h" | |
| 18 #include "SkBitmapRegionDecoder.h" | |
| 19 #include "SkScanlineDecoder.h" | |
| 20 | |
| 21 /* | |
| 22 * This class implements SkBitmapRegionDecoder using SkCanvas. | |
|
scroggo
2015/08/13 16:53:07
by drawing to an SkCanvas?
msarett
2015/08/13 18:10:23
Done.
| |
| 23 */ | |
| 24 class SkBitmapRegionCanvas : public SkBitmapRegionDecoder { | |
| 25 public: | |
| 26 | |
| 27 /* | |
| 28 * This has several key differences from the Android version: | |
|
scroggo
2015/08/13 16:53:07
I think it's probably good to contrast with the an
msarett
2015/08/13 18:10:23
Added comments on the parameters to the base class
| |
| 29 * Returns a Skia bitmap instead of an Android bitmap. | |
| 30 * Android version attempts to reuse a recycled bitmap. | |
| 31 */ | |
| 32 SkBitmap* decodeRegion(int start_x, int start_y, int width, int height, | |
|
scroggo
2015/08/13 16:53:07
Out of curiosity, why does this return a pointer t
msarett
2015/08/13 18:10:23
The reason this returns an SkBitmap* is that I was
| |
| 33 int sampleSize, SkColorType prefColorType) override; | |
| 34 | |
| 35 SkBitmapRegionCanvas(SkScanlineDecoder* decoder); | |
|
scroggo
2015/08/13 16:53:07
nit:
We usually put constructors first, I believe
msarett
2015/08/13 18:10:23
Done.
| |
| 36 | |
| 37 ~SkBitmapRegionCanvas() {} | |
|
scroggo
2015/08/13 16:53:07
Is this necessary? I think the compiler will gener
msarett
2015/08/13 18:10:23
Done.
| |
| 38 | |
| 39 private: | |
| 40 | |
| 41 SkAutoTDelete<SkScanlineDecoder> fDecoder; | |
| 42 | |
| 43 typedef SkBitmapRegionDecoder INHERITED; | |
| 44 | |
| 45 }; | |
| OLD | NEW |