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

Side by Side Diff: ui/android/resources/resource.h

Issue 2746483003: ui/android: Fix Resource meta-data sharing with ResourceManager. (Closed)
Patch Set: jni Created 3 years, 9 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 | « ui/android/resources/nine_patch_resource.cc ('k') | ui/android/resources/resource.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_ANDROID_RESOURCES_RESOURCE_H_
6 #define UI_ANDROID_RESOURCES_RESOURCE_H_
7
8 #include "cc/resources/scoped_ui_resource.h"
9 #include "third_party/skia/include/core/SkBitmap.h"
10 #include "ui/android/ui_android_export.h"
11 #include "ui/gfx/geometry/rect.h"
12
13 namespace ui {
14
15 class UI_ANDROID_EXPORT Resource {
16 public:
17 enum class Type { BITMAP, NINE_PATCH_BITMAP };
18
19 Resource();
20 virtual ~Resource();
21
22 virtual std::unique_ptr<Resource> CreateForCopy();
23 void SetUIResource(std::unique_ptr<cc::ScopedUIResource> ui_resource,
24 const gfx::Size& size_in_px);
25 size_t EstimateMemoryUsage() const;
26
27 cc::ScopedUIResource* ui_resource() const { return ui_resource_.get(); }
28 gfx::Size size() const { return size_; }
29 Type type() const { return type_; }
30
31 protected:
32 Resource(Type type);
33
34 private:
35 const Type type_;
36
37 // Size of the bitmap in physical pixels.
38 gfx::Size size_;
39 std::unique_ptr<cc::ScopedUIResource> ui_resource_;
40 };
41
42 } // namespace ui
43
44 #endif // UI_ANDROID_RESOURCES_RESOURCE_H_
OLDNEW
« no previous file with comments | « ui/android/resources/nine_patch_resource.cc ('k') | ui/android/resources/resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698