Add NULL GL context implementation. Use in bench (-nullgl) and SampleApp (backspace key)
Review URL: http://codereview.appspot.com/5303080/
git-svn-id: http://skia.googlecode.com/svn/trunk@2545 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SampleApp.h b/samplecode/SampleApp.h
index 1d7e66b..dba022a 100644
--- a/samplecode/SampleApp.h
+++ b/samplecode/SampleApp.h
@@ -35,7 +35,8 @@
enum DeviceType {
kRaster_DeviceType,
kPicture_DeviceType,
- kGPU_DeviceType
+ kGPU_DeviceType,
+ kNullGPU_DeviceType
};
/**
* SampleApp ports can subclass this manager class if they want to:
@@ -70,7 +71,7 @@
virtual void windowSizeChanged(SampleWindow* win) = 0;
// return the GrContext backing gpu devices
- virtual GrContext* getGrContext() = 0;
+ virtual GrContext* getGrContext(DeviceType dType) = 0;
};
SampleWindow(void* hwnd, int argc, char** argv, DeviceManager*);
@@ -84,7 +85,7 @@
void toggleFPS();
void showOverview();
- GrContext* getGrContext() const { return fDevManager->getGrContext(); }
+ GrContext* getGrContext() const { return fDevManager->getGrContext(fDeviceType); }
void setZoomCenter(float x, float y);
void changeZoomLevel(float delta);