blob: 2c426f994e0664e173ea929b28fa0d1decd4f0c5 [file] [log] [blame]
Owen Lina2fba682011-08-17 22:07:43 +08001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.gallery3d.ui;
18
19// Texture is a rectangular image which can be drawn on GLCanvas.
20// The isOpaque() function gives a hint about whether the texture is opaque,
21// so the drawing can be done faster.
22//
23// This is the current texture hierarchy:
24//
25// Texture
26// -- ColorTexture
Chih-Chung Chang1b2af5e2011-09-27 19:44:36 +080027// -- FadeInTexture
Owen Lina2fba682011-08-17 22:07:43 +080028// -- BasicTexture
Owen Lina2fba682011-08-17 22:07:43 +080029// -- UploadedTexture
30// -- BitmapTexture
31// -- Tile
32// -- ResourceTexture
33// -- NinePatchTexture
34// -- CanvasTexture
Owen Lina2fba682011-08-17 22:07:43 +080035// -- StringTexture
36//
37public interface Texture {
38 public int getWidth();
39 public int getHeight();
40 public void draw(GLCanvas canvas, int x, int y);
41 public void draw(GLCanvas canvas, int x, int y, int w, int h);
42 public boolean isOpaque();
43}