2013-12-05 13:45:19 +00:00
|
|
|
/*
|
|
|
|
* 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 SkV8Example_DEFINED
|
|
|
|
#define SkV8Example_DEFINED
|
|
|
|
|
|
|
|
#include "SkWindow.h"
|
2013-12-06 15:24:52 +00:00
|
|
|
|
2014-01-06 20:03:55 +00:00
|
|
|
class GrContext;
|
|
|
|
class GrGLInterface;
|
|
|
|
class GrRenderTarget;
|
|
|
|
|
2014-01-06 18:17:24 +00:00
|
|
|
class JsContext;
|
2013-12-05 13:45:19 +00:00
|
|
|
|
|
|
|
class SkV8ExampleWindow : public SkOSWindow {
|
|
|
|
public:
|
2014-01-06 18:17:24 +00:00
|
|
|
SkV8ExampleWindow(void* hwnd, JsContext* canvas);
|
2013-12-05 13:45:19 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE;
|
2014-01-06 20:03:55 +00:00
|
|
|
virtual void onSizeChange() SK_OVERRIDE;
|
|
|
|
|
|
|
|
#if SK_SUPPORT_GPU
|
|
|
|
virtual SkCanvas* createCanvas() SK_OVERRIDE;
|
|
|
|
#endif
|
2013-12-05 13:45:19 +00:00
|
|
|
|
|
|
|
#ifdef SK_BUILD_FOR_WIN
|
|
|
|
virtual void onHandleInval(const SkIRect&) SK_OVERRIDE;
|
|
|
|
#endif
|
|
|
|
|
2014-01-06 20:03:55 +00:00
|
|
|
void windowSizeChanged();
|
|
|
|
|
2013-12-05 13:45:19 +00:00
|
|
|
private:
|
|
|
|
typedef SkOSWindow INHERITED;
|
2014-01-06 18:17:24 +00:00
|
|
|
JsContext* fJsContext;
|
2014-01-06 20:03:55 +00:00
|
|
|
|
|
|
|
#if SK_SUPPORT_GPU
|
|
|
|
GrContext* fCurContext;
|
|
|
|
const GrGLInterface* fCurIntf;
|
|
|
|
GrRenderTarget* fCurRenderTarget;
|
|
|
|
#endif
|
2013-12-05 13:45:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|