Chromium Code Reviews| Index: src/core/SkBitmapController.h |
| diff --git a/src/core/SkBitmapController.h b/src/core/SkBitmapController.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fbc8851be18afded1947c66a67fceb4ec0887d70 |
| --- /dev/null |
| +++ b/src/core/SkBitmapController.h |
| @@ -0,0 +1,40 @@ |
| +/* |
| + * Copyright 2015 Google Inc. |
| + * |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +#ifndef SkBitmapController_DEFINED |
| +#define SkBitmapController_DEFINED |
| + |
| +#include "SkFilterQuality.h" |
| + |
| +class SkBitmap; |
| +class SkMatrix; |
| + |
| +/** |
| + * Handles request to scale, filter, and lock a bitmap to be rasterized. |
| + */ |
| +class SkBitmapController { |
| +public: |
| + bool requestBitmap(const SkBitmap& inBM, const SkMatrix& inverse, SkFilterQuality inQuality, |
| + SkBitmap* outBM, SkMatrix* outInv, SkFilterQuality* outQuality); |
|
scroggo
2015/06/02 13:24:54
Maybe add a comment - it looks like all of these m
reed1
2015/06/02 14:07:46
New version is simpler/clearer.
|
| + |
| +protected: |
| + virtual bool onRequestBitmap(const SkBitmap& inBM, const SkMatrix& inverse, SkFilterQuality inQ, |
| + SkBitmap* outBM, SkMatrix* outInv, SkFilterQuality* outQ) = 0; |
| +}; |
| + |
| +/////////////////////////////////////////////////////////////////////////////////////////////////// |
| + |
| +class SkDefaultBitmapController : public SkBitmapController { |
| +public: |
| + SkDefaultBitmapController() {} |
| + |
| +protected: |
| + bool onRequestBitmap(const SkBitmap&, const SkMatrix&, SkFilterQuality, |
| + SkBitmap*, SkMatrix*, SkFilterQuality*) override; |
| +}; |
| + |
| +#endif |