Merge "Remove unused API" into honeycomb

This commit is contained in:
Romain Guy
2011-01-26 13:41:10 -08:00
committed by Android (Google) Code Review
7 changed files with 2 additions and 120 deletions

View File

@@ -56,8 +56,6 @@ class GLES20Canvas extends HardwareCanvas {
private DrawFilter mFilter;
private boolean mContextLocked;
///////////////////////////////////////////////////////////////////////////
// JNI
///////////////////////////////////////////////////////////////////////////
@@ -223,17 +221,6 @@ class GLES20Canvas extends HardwareCanvas {
private static native void nFinish(int renderer);
@Override
public boolean acquireContext() {
if (!mContextLocked) {
nAcquireContext(mRenderer);
mContextLocked = true;
}
return mContextLocked;
}
private static native void nAcquireContext(int renderer);
@Override
public boolean callDrawGLFunction(int drawGLFunction) {
return nCallDrawGLFunction(mRenderer, drawGLFunction);
@@ -241,16 +228,6 @@ class GLES20Canvas extends HardwareCanvas {
private static native boolean nCallDrawGLFunction(int renderer, int drawGLFunction);
@Override
public void releaseContext() {
if (mContextLocked) {
nReleaseContext(mRenderer);
mContextLocked = false;
}
}
private static native void nReleaseContext(int renderer);
///////////////////////////////////////////////////////////////////////////
// Display list
///////////////////////////////////////////////////////////////////////////

View File

@@ -137,21 +137,11 @@ static void android_view_GLES20Canvas_finish(JNIEnv* env, jobject clazz,
renderer->finish();
}
static void android_view_GLES20Canvas_acquireContext(JNIEnv* env, jobject clazz,
OpenGLRenderer* renderer) {
renderer->acquireContext();
}
static bool android_view_GLES20Canvas_callDrawGLFunction(JNIEnv* env, jobject clazz,
OpenGLRenderer* renderer, Functor *functor) {
return renderer->callDrawGLFunction(functor);
}
static void android_view_GLES20Canvas_releaseContext(JNIEnv* env, jobject clazz,
OpenGLRenderer* renderer) {
renderer->releaseContext();
}
// ----------------------------------------------------------------------------
// State
// ----------------------------------------------------------------------------
@@ -609,8 +599,6 @@ static JNINativeMethod gMethods[] = {
{ "nPrepare", "(IZ)V", (void*) android_view_GLES20Canvas_prepare },
{ "nPrepareDirty", "(IIIIIZ)V", (void*) android_view_GLES20Canvas_prepareDirty },
{ "nFinish", "(I)V", (void*) android_view_GLES20Canvas_finish },
{ "nAcquireContext", "(I)V", (void*) android_view_GLES20Canvas_acquireContext },
{ "nReleaseContext", "(I)V", (void*) android_view_GLES20Canvas_releaseContext },
{ "nCallDrawGLFunction", "(II)Z",
(void*) android_view_GLES20Canvas_callDrawGLFunction },

View File

@@ -1595,51 +1595,6 @@ public class Canvas {
restore();
}
/**
* <p>Acquires the Canvas context. After invoking this method, the Canvas
* context can be modified by the caller. For instance, if you acquire
* the context of an OpenGL Canvas you can reset the GL viewport, scissor,
* etc.</p>
*
* <p>A call to {@link #acquireContext()} should aways be followed by
* a call to {@link #releaseContext()}, preferrably using a try block:</p>
*
* <pre>
* try {
* if (canvas.acquireContext()) {
* // Use the canvas and/or its context
* }
* } finally {
* canvas.releaseContext();
* }
* </pre>
*
* <p>Acquiring the context can be an expensive operation and should not
* be done unless absolutely necessary.</p>
*
* <p>Applications should never invoke this method directly.</p>
*
* @return True if the context could be acquired successfully, false
* otherwise (if the context is already acquired for instance.)
*
* @see #releaseContext()
*
* @hide
*/
public boolean acquireContext() {
return false;
}
/**
* <p>Release the context acquired with {@link #acquireContext()}.</p>
*
* @see #acquireContext()
*
* @hide
*/
public void releaseContext() {
}
/**
* Free up as much memory as possible from private caches (e.g. fonts, images)
*

View File

@@ -82,8 +82,6 @@ void PathHeap::flatten(SkFlattenableWriteBuffer& buffer) const {
///////////////////////////////////////////////////////////////////////////////
const char* DisplayList::OP_NAMES[] = {
"AcquireContext",
"ReleaseContext",
"Save",
"Restore",
"RestoreToCount",
@@ -239,16 +237,6 @@ bool DisplayList::replay(OpenGLRenderer& renderer, uint32_t level) {
needsInvalidate |= renderer.callDrawGLFunction(functor);
}
break;
case AcquireContext: {
DISPLAY_LIST_LOGD("%s%s", (char*) indent, OP_NAMES[op]);
renderer.acquireContext();
}
break;
case ReleaseContext: {
DISPLAY_LIST_LOGD("%s%s", (char*) indent, OP_NAMES[op]);
renderer.releaseContext();
}
break;
case Save: {
int rendererNum = getInt();
DISPLAY_LIST_LOGD("%s%s %d", (char*) indent, OP_NAMES[op], rendererNum);
@@ -644,15 +632,9 @@ void DisplayListRenderer::finish() {
}
void DisplayListRenderer::interrupt() {
}
void DisplayListRenderer::resume() {
}
void DisplayListRenderer::acquireContext() {
// TODO: probably noop instead of calling super
addOp(DisplayList::AcquireContext);
OpenGLRenderer::acquireContext();
}
bool DisplayListRenderer::callDrawGLFunction(Functor *functor) {
@@ -661,12 +643,6 @@ bool DisplayListRenderer::callDrawGLFunction(Functor *functor) {
return false; // No invalidate needed at record-time
}
void DisplayListRenderer::releaseContext() {
// TODO: probably noop instead of calling super
addOp(DisplayList::ReleaseContext);
OpenGLRenderer::releaseContext();
}
int DisplayListRenderer::save(int flags) {
addOp(DisplayList::Save);
addInt(flags);

View File

@@ -89,9 +89,7 @@ public:
// IMPORTANT: Update the intialization of OP_NAMES in the .cpp file
// when modifying this file
enum Op {
AcquireContext = 0,
ReleaseContext,
Save,
Save = 0,
Restore,
RestoreToCount,
SaveLayer,
@@ -245,8 +243,6 @@ public:
void finish();
bool callDrawGLFunction(Functor *functor);
void acquireContext();
void releaseContext();
void interrupt();
void resume();

View File

@@ -191,10 +191,6 @@ void OpenGLRenderer::interrupt() {
mCaches.unbindMeshBuffer();
}
void OpenGLRenderer::acquireContext() {
interrupt();
}
void OpenGLRenderer::resume() {
glViewport(0, 0, mSnapshot->viewport.getWidth(), mSnapshot->viewport.getHeight());
@@ -212,10 +208,6 @@ void OpenGLRenderer::resume() {
glBlendEquation(GL_FUNC_ADD);
}
void OpenGLRenderer::releaseContext() {
resume();
}
bool OpenGLRenderer::callDrawGLFunction(Functor *functor) {
interrupt();
if (mDirtyClip) {

View File

@@ -71,8 +71,6 @@ public:
virtual void resume();
virtual bool callDrawGLFunction(Functor *functor);
virtual void acquireContext();
virtual void releaseContext();
int getSaveCount() const;
virtual int save(int flags);