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

Side by Side Diff: cc/resources/ui_resource_bitmap.h

Issue 143803004: android: Migrate old content readback to use async readback (and delegated renderer) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: consistent device scaling Created 6 years, 10 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
« no previous file with comments | « no previous file | cc/resources/ui_resource_bitmap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 26 matching lines...) Expand all
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);
47 explicit UIResourceBitmap(const skia::RefPtr<SkPixelRef>& pixel_ref); 47 UIResourceBitmap(const skia::RefPtr<SkPixelRef>& pixel_ref, gfx::Size size);
48 ~UIResourceBitmap(); 48 ~UIResourceBitmap();
49 49
50 private: 50 private:
51 friend class AutoLockUIResourceBitmap; 51 friend class AutoLockUIResourceBitmap;
52 52
53 void Create(const skia::RefPtr<SkPixelRef>& pixel_ref, 53 void Create(const skia::RefPtr<SkPixelRef>& pixel_ref,
54 gfx::Size size,
54 UIResourceFormat format); 55 UIResourceFormat format);
55 56
56 skia::RefPtr<SkPixelRef> pixel_ref_; 57 skia::RefPtr<SkPixelRef> pixel_ref_;
57 UIResourceFormat format_; 58 UIResourceFormat format_;
58 UIResourceWrapMode wrap_mode_; 59 UIResourceWrapMode wrap_mode_;
59 gfx::Size size_; 60 gfx::Size size_;
60 bool opaque_; 61 bool opaque_;
61 }; 62 };
62 63
63 class CC_EXPORT AutoLockUIResourceBitmap { 64 class CC_EXPORT AutoLockUIResourceBitmap {
64 public: 65 public:
65 explicit AutoLockUIResourceBitmap(const UIResourceBitmap& bitmap); 66 explicit AutoLockUIResourceBitmap(const UIResourceBitmap& bitmap);
66 ~AutoLockUIResourceBitmap(); 67 ~AutoLockUIResourceBitmap();
67 const uint8_t* GetPixels() const; 68 const uint8_t* GetPixels() const;
68 69
69 private: 70 private:
70 const UIResourceBitmap& bitmap_; 71 const UIResourceBitmap& bitmap_;
71 }; 72 };
72 73
73 } // namespace cc 74 } // namespace cc
74 75
75 #endif // CC_RESOURCES_UI_RESOURCE_BITMAP_H_ 76 #endif // CC_RESOURCES_UI_RESOURCE_BITMAP_H_
OLDNEW
« no previous file with comments | « no previous file | cc/resources/ui_resource_bitmap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698