Reverting r3555
git-svn-id: http://skia.googlecode.com/svn/trunk@3556 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SampleApp.h b/samplecode/SampleApp.h
index ba404da..94f663f 100644
--- a/samplecode/SampleApp.h
+++ b/samplecode/SampleApp.h
@@ -36,9 +36,6 @@
kRaster_DeviceType,
kPicture_DeviceType,
kGPU_DeviceType,
-#if SK_ANGLE
- kANGLE_DeviceType,
-#endif
kNullGPU_DeviceType
};
/**
@@ -50,9 +47,12 @@
*/
class DeviceManager : public SkRefCnt {
public:
- virtual void setUpBackend(SampleWindow* win) = 0;
+ // called at end of SampleWindow cons
+ virtual void init(SampleWindow* win, bool useAltContext) = 0;
- virtual void tearDownBackend(SampleWindow* win) = 0;
+ // called when selecting a new device type
+ // can disallow a device type by returning false.
+ virtual bool supportsDeviceType(DeviceType dType) = 0;
// called before drawing. should install correct device
// type on the canvas. Will skip drawing if returns false.
@@ -71,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*);
@@ -85,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);
@@ -100,8 +100,6 @@
SkData* getPDFData() { return fPDFData; }
void postInvalDelay();
- DeviceType getDeviceType() const { return fDeviceType; }
-
protected:
virtual void onDraw(SkCanvas* canvas);
virtual bool onHandleKey(SkKey key);