Surface::GPU and Surface::HARDWARE are now deprecated; they will be set automatically if needed.

this also ripples into the window manager API by making some constant there deprecated as well.
This commit is contained in:
Mathias Agopian
2009-08-13 17:29:02 -07:00
committed by Jean-Baptiste Queru
parent 81655243a6
commit 317a6280cc
13 changed files with 45 additions and 41 deletions

View File

@@ -145267,7 +145267,7 @@
value="40"
static="true"
final="true"
deprecated="not deprecated"
deprecated="deprecated"
visibility="public"
>
</field>
@@ -145278,7 +145278,7 @@
value="16"
static="true"
final="true"
deprecated="not deprecated"
deprecated="deprecated"
visibility="public"
>
</field>
@@ -145628,7 +145628,7 @@
value="2"
static="true"
final="true"
deprecated="not deprecated"
deprecated="deprecated"
visibility="public"
>
</field>
@@ -145639,7 +145639,7 @@
value="1"
static="true"
final="true"
deprecated="not deprecated"
deprecated="deprecated"
visibility="public"
>
</field>
@@ -155054,7 +155054,7 @@
value="2"
static="true"
final="true"
deprecated="not deprecated"
deprecated="deprecated"
visibility="public"
>
</field>
@@ -155065,7 +155065,7 @@
value="1"
static="true"
final="true"
deprecated="not deprecated"
deprecated="deprecated"
visibility="public"
>
</field>

View File

@@ -130,8 +130,7 @@ status_t BootAnimation::readyToRun() {
// create the native surface
sp<SurfaceControl> control = session()->createSurface(
getpid(), 0, dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_565,
ISurfaceComposer::eGPU);
getpid(), 0, dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_565);
session()->openTransaction();
control->setLayer(0x40000000);
session()->closeTransaction();

View File

@@ -34,12 +34,18 @@ public class Surface implements Parcelable {
/** Surface is created hidden */
public static final int HIDDEN = 0x00000004;
/** The surface is to be used by hardware accelerators or DMA engines */
/** The surface is to be used by hardware accelerators or DMA engines
* @deprecated this is ignored, this value is set automatically when needed.
*/
@Deprecated
public static final int HARDWARE = 0x00000010;
/** Implies "HARDWARE", the surface is to be used by the GPU
* additionally the backbuffer is never preserved for these
* surfaces. */
* surfaces.
* @deprecated this is ignored, this value is set automatically when needed.
*/
@Deprecated
public static final int GPU = 0x00000028;
/** The surface contains secure content, special measures will

View File

@@ -38,8 +38,6 @@ public interface SurfaceHolder {
* Surface type.
*
* @see #SURFACE_TYPE_NORMAL
* @see #SURFACE_TYPE_HARDWARE
* @see #SURFACE_TYPE_GPU
* @see #SURFACE_TYPE_PUSH_BUFFERS
*/
@@ -47,9 +45,15 @@ public interface SurfaceHolder {
* contiguous, cached/buffered RAM. */
public static final int SURFACE_TYPE_NORMAL = MEMORY_TYPE_NORMAL;
/** Surface type: creates a suited to be used with DMA engines and
* hardware accelerators. */
* hardware accelerators.
* @deprecated this is ignored, this value is set automatically when needed.
*/
@Deprecated
public static final int SURFACE_TYPE_HARDWARE = MEMORY_TYPE_HARDWARE;
/** Surface type: creates a surface suited to be used with the GPU */
/** Surface type: creates a surface suited to be used with the GPU
* @deprecated this is ignored, this value is set automatically when needed.
*/
@Deprecated
public static final int SURFACE_TYPE_GPU = MEMORY_TYPE_GPU;
/** Surface type: creates a "push" surface, that is a surface that
* doesn't owns its buffers. With such a surface lockCanvas will fail. */
@@ -139,11 +143,7 @@ public interface SurfaceHolder {
public boolean isCreating();
/**
* Sets the surface's type. Surfaces intended to be used with OpenGL ES
* should be of SURFACE_TYPE_GPU, surfaces accessed by DMA engines and
* hardware accelerators should be of type SURFACE_TYPE_HARDWARE.
* Failing to set the surface's type appropriately could result in
* degraded performance or failure.
* Sets the surface's type.
*
* @param type The surface's memory type.
*/

View File

@@ -573,9 +573,14 @@ public class SurfaceView extends View {
public void setType(int type) {
switch (type) {
case SURFACE_TYPE_NORMAL:
case SURFACE_TYPE_HARDWARE:
case SURFACE_TYPE_GPU:
// these are deprecated, treat as "NORMAL"
type = SURFACE_TYPE_NORMAL;
break;
}
switch (type) {
case SURFACE_TYPE_NORMAL:
case SURFACE_TYPE_PUSH_BUFFERS:
mRequestedType = type;
if (mWindow != null) {

View File

@@ -329,8 +329,6 @@ public interface WindowManager extends ViewManager {
* Default is normal.
*
* @see #MEMORY_TYPE_NORMAL
* @see #MEMORY_TYPE_HARDWARE
* @see #MEMORY_TYPE_GPU
* @see #MEMORY_TYPE_PUSH_BUFFERS
*/
public int memoryType;
@@ -338,10 +336,16 @@ public interface WindowManager extends ViewManager {
/** Memory type: The window's surface is allocated in main memory. */
public static final int MEMORY_TYPE_NORMAL = 0;
/** Memory type: The window's surface is configured to be accessible
* by DMA engines and hardware accelerators. */
* by DMA engines and hardware accelerators.
* @deprecated this is ignored, this value is set automatically when needed.
*/
@Deprecated
public static final int MEMORY_TYPE_HARDWARE = 1;
/** Memory type: The window's surface is configured to be accessible
* by graphics accelerators. */
* by graphics accelerators.
* @deprecated this is ignored, this value is set automatically when needed.
*/
@Deprecated
public static final int MEMORY_TYPE_GPU = 2;
/** Memory type: The window's surface doesn't own its buffers and
* therefore cannot be locked. Instead the buffers are pushed to

View File

@@ -91,9 +91,14 @@ public abstract class BaseSurfaceHolder implements SurfaceHolder {
public void setType(int type) {
switch (type) {
case SURFACE_TYPE_NORMAL:
case SURFACE_TYPE_HARDWARE:
case SURFACE_TYPE_GPU:
// these are deprecated, treat as "NORMAL"
type = SURFACE_TYPE_NORMAL;
break;
}
switch (type) {
case SURFACE_TYPE_NORMAL:
case SURFACE_TYPE_PUSH_BUFFERS:
if (mRequestedType != type) {
mRequestedType = type;

View File

@@ -62,7 +62,6 @@ public class RSSurfaceView extends SurfaceView implements SurfaceHolder.Callback
// underlying surface is created and destroyed
SurfaceHolder holder = getHolder();
holder.addCallback(this);
holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
}
/**

View File

@@ -40,8 +40,6 @@ public:
enum { // (keep in sync with Surface.java)
eHidden = 0x00000004,
eGPU = 0x00000008,
eHardware = 0x00000010,
eDestroyBackbuffer = 0x00000020,
eSecure = 0x00000080,
eNonPremultiplied = 0x00000100,

View File

@@ -109,9 +109,6 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h,
if (err) return err;
uint32_t bufferFlags = 0;
if (flags & ISurfaceComposer::eGPU)
bufferFlags |= Buffer::GPU;
if (flags & ISurfaceComposer::eSecure)
bufferFlags |= Buffer::SECURE;

View File

@@ -53,7 +53,6 @@ class Buffer : public SurfaceBuffer
public:
enum {
DONT_CLEAR = 0x00000001,
GPU = 0x00000002,
SECURE = 0x00000004
};
@@ -98,7 +97,6 @@ class LayerBitmap
public:
enum {
DONT_CLEAR = Buffer::DONT_CLEAR,
GPU = Buffer::GPU,
SECURE = Buffer::SECURE
};
LayerBitmap();

View File

@@ -204,7 +204,6 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
// underlying surface is created and destroyed
SurfaceHolder holder = getHolder();
holder.addCallback(this);
holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
}
/**

View File

@@ -34,8 +34,6 @@ import static android.view.WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
import static android.view.WindowManager.LayoutParams.LAST_APPLICATION_WINDOW;
import static android.view.WindowManager.LayoutParams.LAST_SUB_WINDOW;
import static android.view.WindowManager.LayoutParams.MEMORY_TYPE_GPU;
import static android.view.WindowManager.LayoutParams.MEMORY_TYPE_HARDWARE;
import static android.view.WindowManager.LayoutParams.MEMORY_TYPE_PUSH_BUFFERS;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
@@ -6386,11 +6384,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
int flags = 0;
if (mAttrs.memoryType == MEMORY_TYPE_HARDWARE) {
flags |= Surface.HARDWARE;
} else if (mAttrs.memoryType == MEMORY_TYPE_GPU) {
flags |= Surface.GPU;
} else if (mAttrs.memoryType == MEMORY_TYPE_PUSH_BUFFERS) {
if (mAttrs.memoryType == MEMORY_TYPE_PUSH_BUFFERS) {
flags |= Surface.PUSH_BUFFERS;
}