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-02-27 17:39:40 +00:00
|
|
|
class SkSurface;
|
2014-01-06 20:03:55 +00:00
|
|
|
|
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);
|
2014-02-27 17:39:40 +00:00
|
|
|
virtual ~SkV8ExampleWindow();
|
2013-12-05 13:45:19 +00:00
|
|
|
|
|
|
|
protected:
|
2015-03-26 01:17:31 +00:00
|
|
|
void onDraw(SkCanvas* canvas) override;
|
|
|
|
void onSizeChange() override;
|
2014-01-06 20:03:55 +00:00
|
|
|
|
|
|
|
#if SK_SUPPORT_GPU
|
2015-03-26 01:17:31 +00:00
|
|
|
SkSurface* createSurface() override;
|
2014-01-06 20:03:55 +00:00
|
|
|
#endif
|
2013-12-05 13:45:19 +00:00
|
|
|
|
|
|
|
#ifdef SK_BUILD_FOR_WIN
|
2015-03-26 01:17:31 +00:00
|
|
|
void onHandleInval(const SkIRect&) override;
|
2013-12-05 13:45:19 +00:00
|
|
|
#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;
|
2014-02-27 17:39:40 +00:00
|
|
|
SkSurface* fCurSurface;
|
2014-01-06 20:03:55 +00:00
|
|
|
#endif
|
2013-12-05 13:45:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|