144a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org/*
244a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org * Copyright 2013 Google Inc.
344a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org *
444a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org *
544a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org * Use of this source code is governed by a BSD-style license that can be
644a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org * found in the LICENSE file.
744a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org *
844a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org */
944a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org
1044a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org#ifndef SkV8Example_DEFINED
1144a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org#define SkV8Example_DEFINED
1244a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org
1344a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org#include "SkWindow.h"
1480bd0c995d9ec6a70330d6dc3f2f8dd387701d1dcommit-bot@chromium.org
159ee0e32886254fc3feba9ab25ec112b270085b92commit-bot@chromium.orgclass GrContext;
169ee0e32886254fc3feba9ab25ec112b270085b92commit-bot@chromium.orgclass GrGLInterface;
179ee0e32886254fc3feba9ab25ec112b270085b92commit-bot@chromium.orgclass GrRenderTarget;
18939560b87a392911c5aeaacdbd1f8d26fe4845adcommit-bot@chromium.orgclass SkSurface;
199ee0e32886254fc3feba9ab25ec112b270085b92commit-bot@chromium.org
20c8d732800e1a660fca6d2478fc24d6e6935ef8adcommit-bot@chromium.orgclass JsContext;
2144a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org
2244a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.orgclass SkV8ExampleWindow : public SkOSWindow {
2344a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.orgpublic:
24c8d732800e1a660fca6d2478fc24d6e6935ef8adcommit-bot@chromium.org    SkV8ExampleWindow(void* hwnd, JsContext* canvas);
25939560b87a392911c5aeaacdbd1f8d26fe4845adcommit-bot@chromium.org    virtual ~SkV8ExampleWindow();
2644a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org
2744a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.orgprotected:
2844a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org    virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE;
299ee0e32886254fc3feba9ab25ec112b270085b92commit-bot@chromium.org    virtual void onSizeChange() SK_OVERRIDE;
309ee0e32886254fc3feba9ab25ec112b270085b92commit-bot@chromium.org
319ee0e32886254fc3feba9ab25ec112b270085b92commit-bot@chromium.org#if SK_SUPPORT_GPU
329ee0e32886254fc3feba9ab25ec112b270085b92commit-bot@chromium.org    virtual SkCanvas* createCanvas() SK_OVERRIDE;
339ee0e32886254fc3feba9ab25ec112b270085b92commit-bot@chromium.org#endif
3444a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org
3544a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org#ifdef SK_BUILD_FOR_WIN
3644a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org    virtual void onHandleInval(const SkIRect&) SK_OVERRIDE;
3744a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org#endif
3844a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org
399ee0e32886254fc3feba9ab25ec112b270085b92commit-bot@chromium.org    void windowSizeChanged();
409ee0e32886254fc3feba9ab25ec112b270085b92commit-bot@chromium.org
4144a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.orgprivate:
4244a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org    typedef SkOSWindow INHERITED;
43c8d732800e1a660fca6d2478fc24d6e6935ef8adcommit-bot@chromium.org    JsContext* fJsContext;
449ee0e32886254fc3feba9ab25ec112b270085b92commit-bot@chromium.org
459ee0e32886254fc3feba9ab25ec112b270085b92commit-bot@chromium.org#if SK_SUPPORT_GPU
469ee0e32886254fc3feba9ab25ec112b270085b92commit-bot@chromium.org    GrContext*              fCurContext;
479ee0e32886254fc3feba9ab25ec112b270085b92commit-bot@chromium.org    const GrGLInterface*    fCurIntf;
489ee0e32886254fc3feba9ab25ec112b270085b92commit-bot@chromium.org    GrRenderTarget*         fCurRenderTarget;
49939560b87a392911c5aeaacdbd1f8d26fe4845adcommit-bot@chromium.org    SkSurface*              fCurSurface;
509ee0e32886254fc3feba9ab25ec112b270085b92commit-bot@chromium.org#endif
5144a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org};
5244a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org
5344a3877442805f48158c0d1e936b9c3970ddd3afcommit-bot@chromium.org#endif
54