Chromium Code Reviews| Index: experimental/SkiaExamples/BaseExample.h |
| diff --git a/experimental/SkiaExamples/BaseExample.h b/experimental/SkiaExamples/BaseExample.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4fd89c0d88f08e7489050bf8d9248364c8be0ca3 |
| --- /dev/null |
| +++ b/experimental/SkiaExamples/BaseExample.h |
| @@ -0,0 +1,50 @@ |
| +/* |
| + * Copyright 2013 Google Inc. |
| + * |
| + * |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + * |
| + */ |
| + |
| +#ifndef BaseExample_DEFINED |
| +#define BaseExample_DEFINED |
| + |
| +#include "SkWindow.h" |
| + |
| +class GrContext; |
| +struct GrGLInterface; |
| +class GrRenderTarget; |
| +class SkCanvas; |
| + |
| +class BaseExample : public SkOSWindow { |
| +public: |
| + enum DeviceType { |
| + kRaster_DeviceType, |
| + kGPU_DeviceType, |
| + }; |
| + BaseExample(void* hWnd, int argc, char** argv); |
| + ~BaseExample(); |
|
caryclark
2013/06/10 15:48:40
This hides the virtual destructor for SkOSWIndows,
sglez
2013/06/11 04:24:38
Thanks,
Refactored into a tearDownBackend to use w
|
| + |
| + // Changes the device type of the object. |
| + void setupBackend(DeviceType type); |
| + |
| + DeviceType getDeviceType() const { return fType; } |
| + |
| +protected: |
| + // Your class should override this method to do its thing. |
| + virtual void draw(SkCanvas* canvas) SK_OVERRIDE; |
| + |
| + SkCanvas* createCanvas() SK_OVERRIDE; |
| + |
| +private: |
| + DeviceType fType; |
| + |
| + |
|
caryclark
2013/06/10 15:48:40
why two blank lines?
sglez
2013/06/11 04:24:38
Corrected.
|
| + GrContext* fContext; |
| + GrRenderTarget* fRenderTarget; |
| + GrGLInterface* fInterface; |
| + typedef SkOSWindow INHERITED; |
| +}; |
| +#endif |
| + |