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

Unified Diff: content/public/android/java/src/org/chromium/content_public/resources/Resource.java

Issue 731133002: Upstream ResourceManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add generated enum class to BUILD.gn Created 6 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 side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content_public/resources/Resource.java
diff --git a/content/public/android/java/src/org/chromium/content_public/resources/Resource.java b/content/public/android/java/src/org/chromium/content_public/resources/Resource.java
new file mode 100644
index 0000000000000000000000000000000000000000..e1d909ea535c3c14c0271fd6f4523399f621073f
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content_public/resources/Resource.java
@@ -0,0 +1,38 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.content_public.resources;
+
+import android.graphics.Bitmap;
+import android.graphics.Rect;
+
+/**
+ * A basic resource interface that all assets must use to be exposed to the CC layer as
+ * UIResourceIds.
+ */
+public interface Resource {
+ /**
+ * This may be called more than once so if possible avoid doing redundant work.
+ * @return A {@link Bitmap} representing the resource.
+ */
+ Bitmap getBitmap();
+
+ /**
+ * @return The size of the bitmap.
+ */
+ Rect getBitmapSize();
+
+ /**
+ * @return The padded content area of this resource. For 9-patches this will represent the
+ * valid content of the 9-patch. It can mean other things for other Resources though.
+ */
+ Rect getPadding();
+
+ /**
+ * @return The aperture of this resource. For 9-patches this will represent the area of the
+ * {@link Bitmap} that should not be stretched. It can mean other things for other
+ * Resources though.
+ */
+ Rect getAperture();
+}

Powered by Google App Engine
This is Rietveld 408576698