Pull parts of GeckoSoftwareLayerClient that will be used for GL layers into a generic GeckoLayerClient class

This commit is contained in:
Patrick Walton
2012-02-02 22:07:05 -08:00
parent 85326bec09
commit 9b354ce67e
5 changed files with 442 additions and 303 deletions

View File

@@ -149,11 +149,32 @@ protected:
static jfieldID jTopField;
};
class AndroidGeckoSoftwareLayerClient : public WrappedJavaObject {
class AndroidGeckoLayerClient : public WrappedJavaObject {
public:
static void InitGeckoLayerClientClass(JNIEnv *jEnv);
void Init(jobject jobj);
bool BeginDrawing(int aWidth, int aHeight, int aTileWidth, int aTileHeight,
const nsAString &aMetadata, bool aHasDirectTexture);
void EndDrawing(const nsIntRect &aRect);
protected:
AndroidGeckoLayerClient() {
// You shouldn't directly instantiate one of these; instead use one of the concrete derived
// classes.
}
static jclass jGeckoLayerClientClass;
static jmethodID jBeginDrawingMethod;
static jmethodID jEndDrawingMethod;
};
class AndroidGeckoSoftwareLayerClient : public AndroidGeckoLayerClient {
public:
static void InitGeckoSoftwareLayerClientClass(JNIEnv *jEnv);
void Init(jobject jobj);
void Init(jobject jobj);
AndroidGeckoSoftwareLayerClient() {}
AndroidGeckoSoftwareLayerClient(jobject jobj) { Init(jobj); }
@@ -162,8 +183,6 @@ public:
unsigned char *LockBufferBits();
void UnlockBuffer();
void GetRenderOffset(nsIntPoint &aOffset);
bool BeginDrawing(int aWidth, int aHeight, int aTileWidth, int aTileHeight, const nsAString &aMetadata, bool aHasDirectTexture);
void EndDrawing(const nsIntRect &aRect);
private:
static jclass jGeckoSoftwareLayerClientClass;
@@ -171,9 +190,7 @@ private:
static jmethodID jUnlockBufferMethod;
protected:
static jmethodID jGetRenderOffsetMethod;
static jmethodID jBeginDrawingMethod;
static jmethodID jEndDrawingMethod;
static jmethodID jGetRenderOffsetMethod;
};