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

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

Issue 1463373002: scaling API on SkPixmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « src/core/SkBitmapController.cpp ('k') | src/core/SkBitmapProvider.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkBitmapProvider_DEFINED 8 #ifndef SkBitmapProvider_DEFINED
9 #define SkBitmapProvider_DEFINED 9 #define SkBitmapProvider_DEFINED
10 10
11 #include "SkBitmap.h" 11 #include "SkBitmap.h"
12 #include "SkImage.h" 12 #include "SkImage.h"
13 #include "SkBitmapCache.h" 13 #include "SkBitmapCache.h"
14 14
15 class SkBitmapProvider { 15 class SkBitmapProvider {
16 public: 16 public:
17 explicit SkBitmapProvider(const SkBitmap& bm) : fBitmap(bm) {} 17 explicit SkBitmapProvider(const SkBitmap& bm) : fBitmap(bm) {}
18 explicit SkBitmapProvider(const SkImage* img) : fImage(SkSafeRef(img)) {} 18 explicit SkBitmapProvider(const SkImage* img) : fImage(SkSafeRef(img)) {}
19 SkBitmapProvider(const SkBitmapProvider& other) 19 SkBitmapProvider(const SkBitmapProvider& other)
20 : fBitmap(other.fBitmap) 20 : fBitmap(other.fBitmap)
21 , fImage(SkSafeRef(other.fImage.get())) 21 , fImage(SkSafeRef(other.fImage.get()))
22 {} 22 {}
23 23
24 int width() const; 24 int width() const;
25 int height() const; 25 int height() const;
26 uint32_t getID() const; 26 uint32_t getID() const;
27 27
28 bool validForDrawing() const; 28 bool validForDrawing() const;
29 SkImageInfo info() const; 29 SkImageInfo info() const;
30 bool isVolatile() const;
30 31
31 SkBitmapCacheDesc makeCacheDesc(int w, int h) const; 32 SkBitmapCacheDesc makeCacheDesc(int w, int h) const;
32 SkBitmapCacheDesc makeCacheDesc() const; 33 SkBitmapCacheDesc makeCacheDesc() const;
33 void notifyAddedToCache() const; 34 void notifyAddedToCache() const;
34 35
35 // Only call this if you're sure you need the bits, since it maybe expensive 36 // Only call this if you're sure you need the bits, since it maybe expensive
36 // ... cause a decode and cache, or gpu-readback 37 // ... cause a decode and cache, or gpu-readback
37 bool asBitmap(SkBitmap*) const; 38 bool asBitmap(SkBitmap*) const;
38 39
39 private: 40 private:
40 SkBitmap fBitmap; 41 SkBitmap fBitmap;
41 SkAutoTUnref<const SkImage> fImage; 42 SkAutoTUnref<const SkImage> fImage;
42 }; 43 };
43 44
44 #endif 45 #endif
OLDNEW
« no previous file with comments | « src/core/SkBitmapController.cpp ('k') | src/core/SkBitmapProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698