Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: src/core/SkBitmapController.h

Issue 1153123003: refactor bitmapshader to use a controller (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW
« no previous file with comments | « gyp/core.gypi ('k') | src/core/SkBitmapController.cpp » ('j') | src/core/SkBitmapController.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698