| 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 GPU_SKIA_BINDINGS_GRCONTEXT_FOR_GLES2_INTERFACE_H_ | 5 #ifndef GPU_SKIA_BINDINGS_GRCONTEXT_FOR_GLES2_INTERFACE_H_ |
| 6 #define GPU_SKIA_BINDINGS_GRCONTEXT_FOR_GLES2_INTERFACE_H_ | 6 #define GPU_SKIA_BINDINGS_GRCONTEXT_FOR_GLES2_INTERFACE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "third_party/skia/include/core/SkRefCnt.h" | 9 #include "third_party/skia/include/core/SkRefCnt.h" |
| 10 | 10 |
| 11 class GrContext; | 11 class GrContext; |
| 12 | 12 |
| 13 namespace gpu { | 13 namespace gpu { |
| 14 struct Capabilities; |
| 15 |
| 14 namespace gles2 { | 16 namespace gles2 { |
| 15 class GLES2Interface; | 17 class GLES2Interface; |
| 16 } | 18 } |
| 17 } | 19 } |
| 18 | 20 |
| 19 namespace skia_bindings { | 21 namespace skia_bindings { |
| 20 | 22 |
| 21 // This class binds an offscreen GrContext to an offscreen context3d. The | 23 // 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 | 24 // context3d is used by the GrContext so must be valid as long as this class |
| 23 // is alive. | 25 // is alive. |
| 24 class GrContextForGLES2Interface { | 26 class GrContextForGLES2Interface { |
| 25 public: | 27 public: |
| 26 explicit GrContextForGLES2Interface(gpu::gles2::GLES2Interface* gl); | 28 explicit GrContextForGLES2Interface(gpu::gles2::GLES2Interface* gl, |
| 29 const gpu::Capabilities& capabilities); |
| 27 virtual ~GrContextForGLES2Interface(); | 30 virtual ~GrContextForGLES2Interface(); |
| 28 | 31 |
| 29 GrContext* get() { return gr_context_.get(); } | 32 GrContext* get() { return gr_context_.get(); } |
| 30 | 33 |
| 31 void OnLostContext(); | 34 void OnLostContext(); |
| 32 void ResetContext(uint32_t state); | 35 void ResetContext(uint32_t state); |
| 33 void FreeGpuResources(); | 36 void FreeGpuResources(); |
| 34 | 37 |
| 35 private: | 38 private: |
| 36 sk_sp<class GrContext> gr_context_; | 39 sk_sp<class GrContext> gr_context_; |
| 37 | 40 |
| 38 DISALLOW_COPY_AND_ASSIGN(GrContextForGLES2Interface); | 41 DISALLOW_COPY_AND_ASSIGN(GrContextForGLES2Interface); |
| 39 }; | 42 }; |
| 40 | 43 |
| 41 } // namespace skia_bindings | 44 } // namespace skia_bindings |
| 42 | 45 |
| 43 #endif // GPU_SKIA_BINDINGS_GRCONTEXT_FOR_GLES2_INTERFACE_H_ | 46 #endif // GPU_SKIA_BINDINGS_GRCONTEXT_FOR_GLES2_INTERFACE_H_ |
| OLD | NEW |