Fix some minor bugs with GL state setup that were exposed by Droids driver.
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index b558de0..29361af 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -246,13 +246,8 @@
}
}
- void validateSurface() {
- //if (mSurface == null) {
- //throw new IllegalStateException("Uploading data to GL with no surface.");
- //}
- }
-
public void contextSetPriority(Priority p) {
+ validate();
nContextSetPriority(p.mID);
}
@@ -312,14 +307,17 @@
mSurface = sur;
mWidth = w;
mHeight = h;
+ validate();
nContextSetSurface(w, h, mSurface);
}
public void contextDump(int bits) {
+ validate();
nContextDump(bits);
}
public void destroy() {
+ validate();
nContextDeinitToClient();
mMessageThread.mRun = false;
@@ -335,10 +333,12 @@
}
void pause() {
+ validate();
nContextPause();
}
void resume() {
+ validate();
nContextResume();
}
@@ -379,22 +379,27 @@
}
public void contextBindRootScript(Script s) {
+ validate();
nContextBindRootScript(safeID(s));
}
public void contextBindProgramFragmentStore(ProgramStore p) {
+ validate();
nContextBindProgramFragmentStore(safeID(p));
}
public void contextBindProgramFragment(ProgramFragment p) {
+ validate();
nContextBindProgramFragment(safeID(p));
}
public void contextBindProgramRaster(ProgramRaster p) {
+ validate();
nContextBindProgramRaster(safeID(p));
}
public void contextBindProgramVertex(ProgramVertex p) {
+ validate();
nContextBindProgramVertex(safeID(p));
}