Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2015 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 | |
| 8 #ifndef SkBitmapController_DEFINED | |
| 9 #define SkBitmapController_DEFINED | |
| 10 | |
| 11 #include "SkBitmap.h" | |
| 12 #include "SkFilterQuality.h" | |
| 13 #include "SkMatrix.h" | |
| 14 | |
| 15 class SkInPlace; | |
| 16 | |
| 17 /** | |
| 18 * Handles request to scale, filter, and lock a bitmap to be rasterized. | |
| 19 */ | |
| 20 class SkBitmapController { | |
|
scroggo
2015/06/02 21:17:33
I tend to default to making classes noncopyable. I
reed1
2015/06/04 13:17:03
Done.
| |
| 21 public: | |
| 22 class State { | |
|
scroggo
2015/06/02 21:17:34
Should this be noncopyable?
The only harm/weirdne
reed1
2015/06/04 13:17:03
Done.
| |
| 23 public: | |
| 24 virtual ~State() {} | |
| 25 | |
| 26 const SkBitmap& lockedBitmap() const { return fLockedBitmap; } | |
| 27 const SkMatrix& invMatrix() const { return fInvMatrix; } | |
| 28 SkFilterQuality quality() const { return fQuality; } | |
| 29 | |
| 30 protected: | |
| 31 SkBitmap fLockedBitmap; | |
| 32 SkMatrix fInvMatrix; | |
| 33 SkFilterQuality fQuality; | |
| 34 | |
| 35 private: | |
| 36 friend class SkBitmapController; | |
| 37 }; | |
| 38 | |
| 39 virtual ~SkBitmapController() {} | |
| 40 | |
| 41 State* requestBitmap(const SkBitmap&, const SkMatrix& inverse, SkFilterQuali ty, | |
|
scroggo
2015/06/02 21:17:33
This will matter more once it's public:
Add a com
| |
| 42 SkInPlace* = NULL); | |
| 43 | |
| 44 protected: | |
| 45 virtual State* onRequestBitmap(const SkBitmap&, const SkMatrix& inverse, SkF ilterQuality, | |
| 46 SkInPlace&) = 0; | |
| 47 }; | |
| 48 | |
| 49 //////////////////////////////////////////////////////////////////////////////// /////////////////// | |
| 50 | |
| 51 class SkDefaultBitmapController : public SkBitmapController { | |
| 52 public: | |
| 53 SkDefaultBitmapController() {} | |
| 54 | |
| 55 protected: | |
| 56 State* onRequestBitmap(const SkBitmap&, const SkMatrix& inverse, SkFilterQua lity, | |
| 57 SkInPlace&) override; | |
| 58 }; | |
| 59 | |
| 60 #endif | |
| OLD | NEW |