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

Side by Side Diff: ui/android/java/src/org/chromium/ui/resources/Resource.java

Issue 2746483003: ui/android: Fix Resource meta-data sharing with ResourceManager. (Closed)
Patch Set: address comments 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 package org.chromium.ui.resources; 5 package org.chromium.ui.resources;
6 6
7 import android.graphics.Bitmap; 7 import android.graphics.Bitmap;
8 import android.graphics.Rect; 8 import android.graphics.Rect;
9 9
10 /** 10 /**
11 * A basic resource interface that all assets must use to be exposed to the CC l ayer as 11 * A basic resource interface that all assets must use to be exposed to the CC l ayer as
12 * UIResourceIds. 12 * UIResourceIds.
13 */ 13 */
14 public interface Resource { 14 public interface Resource {
15 /** 15 /**
16 * This may be called more than once so if possible avoid doing redundant wo rk. 16 * This may be called more than once so if possible avoid doing redundant wo rk.
17 * @return A {@link Bitmap} representing the resource. 17 * @return A {@link Bitmap} representing the resource.
18 */ 18 */
19 Bitmap getBitmap(); 19 Bitmap getBitmap();
20 20
21 /** 21 /**
22 * @return The size of the bitmap. 22 * @return The size of the bitmap.
23 */ 23 */
24 Rect getBitmapSize(); 24 Rect getBitmapSize();
25 25
26 /** 26 /**
27 * @return The padded content area of this resource. For 9-patches this wil l represent the 27 * Creates the native representation of this Resource. Note that the ownersh ip is passed to the
28 * valid content of the 9-patch. It can mean other things for other Resources though. 28 * caller.
29 * @return The pointer to the native Resource.
29 */ 30 */
30 Rect getPadding(); 31 long createNativeResource();
31
32 /**
33 * @return The aperture of this resource. For 9-patches this will represent the area of the
34 * {@link Bitmap} that should not be stretched. It can mean other t hings for other
35 * Resources though.
36 */
37 Rect getAperture();
38 } 32 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698