blob: dd57da2c753bc73811bde3ec420e92095cf3478b [file] [log] [blame]
reed@google.com7b201d22011-01-11 18:59:23 +00001/*
2 Copyright 2010 Google Inc.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 */
16
17#ifndef SkGpuDeviceFactory_DEFINED
18#define SkGpuDeviceFactory_DEFINED
19
20#include "SkDevice.h"
21
22class GrContext;
23
24class SkGpuDeviceFactory : public SkDeviceFactory {
25public:
26 /**
27 * The constructor will ref() the context, passing it to each device
28 * that it creates. It will be unref()'d in the destructor
29 */
30 SkGpuDeviceFactory(GrContext*);
31
32 virtual ~SkGpuDeviceFactory();
33
34 virtual SkDevice* newDevice(SkCanvas*, SkBitmap::Config, int width,
35 int height, bool isOpaque, bool isLayer);
36
37private:
38 GrContext* fContext;
39};
40
41#endif
42