OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_RESOURCES_UI_RESOURCE_BITMAP_H_ | 5 #ifndef CC_RESOURCES_UI_RESOURCE_BITMAP_H_ |
6 #define CC_RESOURCES_UI_RESOURCE_BITMAP_H_ | 6 #define CC_RESOURCES_UI_RESOURCE_BITMAP_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
(...skipping 25 matching lines...) Expand all Loading... | |
36 | 36 |
37 gfx::Size GetSize() const { return size_; } | 37 gfx::Size GetSize() const { return size_; } |
38 UIResourceFormat GetFormat() const { return format_; } | 38 UIResourceFormat GetFormat() const { return format_; } |
39 UIResourceWrapMode GetWrapMode() const { return wrap_mode_; } | 39 UIResourceWrapMode GetWrapMode() const { return wrap_mode_; } |
40 void SetWrapMode(UIResourceWrapMode wrap_mode) { wrap_mode_ = wrap_mode; } | 40 void SetWrapMode(UIResourceWrapMode wrap_mode) { wrap_mode_ = wrap_mode; } |
41 bool GetOpaque() const { return opaque_; } | 41 bool GetOpaque() const { return opaque_; } |
42 void SetOpaque(bool opaque) { opaque_ = opaque; } | 42 void SetOpaque(bool opaque) { opaque_ = opaque; } |
43 | 43 |
44 // User must ensure that |skbitmap| is immutable. The SkBitmap Format should | 44 // User must ensure that |skbitmap| is immutable. The SkBitmap Format should |
45 // be 32-bit RGBA. | 45 // be 32-bit RGBA. |
46 explicit UIResourceBitmap(const SkBitmap& skbitmap); | 46 explicit UIResourceBitmap(const SkBitmap& skbitmap); |
danakj
2014/03/25 16:13:59
Are there no callers of this constructor anymore t
reed1
2014/03/25 17:19:41
still used. e.g. cc/layers/painted_scrollbar_layer
| |
47 UIResourceBitmap(int width, int height, bool isOpaque = false); | |
danakj
2014/03/25 16:13:59
this should be |is_opaque| or just |opaque|. howev
reed1
2014/03/25 17:19:41
I'll remove the defaultness of the argument.
danakj
2014/03/25 17:31:29
Yeh, I'm not a fan of so many constructors either.
| |
47 UIResourceBitmap(const skia::RefPtr<SkPixelRef>& pixel_ref, gfx::Size size); | 48 UIResourceBitmap(const skia::RefPtr<SkPixelRef>& pixel_ref, gfx::Size size); |
48 ~UIResourceBitmap(); | 49 ~UIResourceBitmap(); |
49 | 50 |
50 private: | 51 private: |
51 friend class AutoLockUIResourceBitmap; | 52 friend class AutoLockUIResourceBitmap; |
52 | 53 |
53 void Create(const skia::RefPtr<SkPixelRef>& pixel_ref, | 54 void Create(const skia::RefPtr<SkPixelRef>& pixel_ref, |
54 gfx::Size size, | 55 gfx::Size size, |
55 UIResourceFormat format); | 56 UIResourceFormat format); |
56 | 57 |
(...skipping 10 matching lines...) Expand all Loading... | |
67 ~AutoLockUIResourceBitmap(); | 68 ~AutoLockUIResourceBitmap(); |
68 const uint8_t* GetPixels() const; | 69 const uint8_t* GetPixels() const; |
69 | 70 |
70 private: | 71 private: |
71 const UIResourceBitmap& bitmap_; | 72 const UIResourceBitmap& bitmap_; |
72 }; | 73 }; |
73 | 74 |
74 } // namespace cc | 75 } // namespace cc |
75 | 76 |
76 #endif // CC_RESOURCES_UI_RESOURCE_BITMAP_H_ | 77 #endif // CC_RESOURCES_UI_RESOURCE_BITMAP_H_ |
OLD | NEW |