| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_COMMON_GPU_GRCONTEXT_FOR_WEBGRAPHICSCONTEXT3D_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GRCONTEXT_FOR_WEBGRAPHICSCONTEXT3D_H_ |
| 6 #define WEBKIT_COMMON_GPU_GRCONTEXT_FOR_WEBGRAPHICSCONTEXT3D_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GRCONTEXT_FOR_WEBGRAPHICSCONTEXT3D_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/macros.h" |
| 9 #include "skia/ext/refptr.h" | 9 #include "skia/ext/refptr.h" |
| 10 #include "webkit/common/gpu/webkit_gpu_export.h" | |
| 11 | 10 |
| 12 class GrContext; | 11 class GrContext; |
| 13 | 12 |
| 14 namespace gpu_blink { | 13 namespace gpu_blink { |
| 15 class WebGraphicsContext3DImpl; | 14 class WebGraphicsContext3DImpl; |
| 16 } | 15 } |
| 17 | 16 |
| 18 namespace webkit { | 17 namespace content { |
| 19 namespace gpu { | |
| 20 | 18 |
| 21 // This class binds an offscreen GrContext to an offscreen context3d. The | 19 // This class binds an offscreen GrContext to an offscreen context3d. The |
| 22 // context3d is used by the GrContext so must be valid as long as this class | 20 // context3d is used by the GrContext so must be valid as long as this class |
| 23 // is alive. | 21 // is alive. |
| 24 class WEBKIT_GPU_EXPORT GrContextForWebGraphicsContext3D { | 22 class GrContextForWebGraphicsContext3D { |
| 25 public: | 23 public: |
| 26 explicit GrContextForWebGraphicsContext3D( | 24 explicit GrContextForWebGraphicsContext3D( |
| 27 gpu_blink::WebGraphicsContext3DImpl* context3d); | 25 gpu_blink::WebGraphicsContext3DImpl* context3d); |
| 28 virtual ~GrContextForWebGraphicsContext3D(); | 26 virtual ~GrContextForWebGraphicsContext3D(); |
| 29 | 27 |
| 30 GrContext* get() { return gr_context_.get(); } | 28 GrContext* get() { return gr_context_.get(); } |
| 31 | 29 |
| 32 void OnLostContext(); | 30 void OnLostContext(); |
| 33 void FreeGpuResources(); | 31 void FreeGpuResources(); |
| 34 | 32 |
| 35 private: | 33 private: |
| 36 skia::RefPtr<class GrContext> gr_context_; | 34 skia::RefPtr<class GrContext> gr_context_; |
| 37 | 35 |
| 38 DISALLOW_COPY_AND_ASSIGN(GrContextForWebGraphicsContext3D); | 36 DISALLOW_COPY_AND_ASSIGN(GrContextForWebGraphicsContext3D); |
| 39 }; | 37 }; |
| 40 | 38 |
| 41 } // namespace gpu | 39 } // namespace content |
| 42 } // namespace webkit | |
| 43 | 40 |
| 44 #endif // WEBKIT_COMMON_GPU_GRCONTEXT_FOR_WEBGRAPHICSCONTEXT3D_H_ | 41 #endif // CONTENT_COMMON_GPU_CLIENT_GRCONTEXT_FOR_WEBGRAPHICSCONTEXT3D_H_ |
| OLD | NEW |