Add a function to create a bookmark app from a WebApplicationInfo.
[chromium-blink-merge.git] / webkit / common / gpu / grcontext_for_webgraphicscontext3d.h
blob96bb41454f8a2738f6dd1c5bc34e2918119b39b5
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef WEBKIT_COMMON_GPU_GRCONTEXT_FOR_WEBGRAPHICSCONTEXT3D_H_
6 #define WEBKIT_COMMON_GPU_GRCONTEXT_FOR_WEBGRAPHICSCONTEXT3D_H_
8 #include "base/basictypes.h"
9 #include "skia/ext/refptr.h"
10 #include "webkit/common/gpu/webkit_gpu_export.h"
12 class GrContext;
13 namespace blink { class WebGraphicsContext3D; }
15 namespace webkit {
16 namespace gpu {
18 // This class binds an offscreen GrContext to an offscreen context3d. The
19 // context3d is used by the GrContext so must be valid as long as this class
20 // is alive.
21 class WEBKIT_GPU_EXPORT GrContextForWebGraphicsContext3D {
22 public:
23 explicit GrContextForWebGraphicsContext3D(
24 blink::WebGraphicsContext3D* context3d);
25 virtual ~GrContextForWebGraphicsContext3D();
27 GrContext* get() { return gr_context_.get(); }
29 void SetMemoryLimit(bool nonzero_allocation);
31 private:
32 skia::RefPtr<class GrContext> gr_context_;
34 DISALLOW_COPY_AND_ASSIGN(GrContextForWebGraphicsContext3D);
37 } // namespace gpu
38 } // namespace webkit
40 #endif // WEBKIT_COMMON_GPU_GRCONTEXT_FOR_WEBGRAPHICSCONTEXT3D_H_