blob: d16e81af7ea2e5e89078ca19c455dfbfc86d04c2 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
2/*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
yangsu@google.comc5aeccd2011-07-17 14:42:08 +00008#ifndef SkiOSDeviceManager_DEFINED
9#define SkiOSDeviceManager_DEFINED
10#include "SampleApp.h"
11#include "SkCanvas.h"
12#include "GrContext.h"
13#include "GrGLInterface.h"
14#include "SkGpuDevice.h"
15#include "SkCGUtils.h"
16#include "GrContext.h"
17class SkiOSDeviceManager : public SampleWindow::DeviceManager {
18public:
19 SkiOSDeviceManager();
20 virtual ~SkiOSDeviceManager();
21
22 virtual void init(SampleWindow* win);
23
24 virtual bool supportsDeviceType(SampleWindow::DeviceType dType);
25 virtual bool prepareCanvas(SampleWindow::DeviceType dType,
26 SkCanvas* canvas,
27 SampleWindow* win);
28 virtual void publishCanvas(SampleWindow::DeviceType dType,
29 SkCanvas* canvas,
30 SampleWindow* win);
31
32 virtual void windowSizeChanged(SampleWindow* win) {}
33
34 bool isUsingGL() { return usingGL; }
35
36 virtual GrContext* getGrContext() { return fGrContext; }
37private:
38 bool usingGL;
39 GrContext* fGrContext;
40 GrRenderTarget* fGrRenderTarget;
41};
42
43#endif