| 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 CONTENT_COMMON_GPU_CLIENT_GRCONTEXT_FOR_GLES2_INTERFACE_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GRCONTEXT_FOR_GLES2_INTERFACE_H_ | 
| 6 #define CONTENT_COMMON_GPU_CLIENT_GRCONTEXT_FOR_GLES2_INTERFACE_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GRCONTEXT_FOR_GLES2_INTERFACE_H_ | 
| 7 | 7 | 
| 8 #include "base/macros.h" | 8 #include "base/macros.h" | 
| 9 #include "skia/ext/refptr.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 namespace gles2 { | 14 namespace gles2 { | 
| 15 class GLES2Interface; | 15 class GLES2Interface; | 
| 16 } | 16 } | 
| 17 } | 17 } | 
| 18 | 18 | 
| 19 namespace content { | 19 namespace content { | 
| 20 | 20 | 
| 21 // This class binds an offscreen GrContext to an offscreen context3d. The | 21 // 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 | 22 // context3d is used by the GrContext so must be valid as long as this class | 
| 23 // is alive. | 23 // is alive. | 
| 24 class GrContextForGLES2Interface { | 24 class GrContextForGLES2Interface { | 
| 25  public: | 25  public: | 
| 26   explicit GrContextForGLES2Interface(gpu::gles2::GLES2Interface* gl); | 26   explicit GrContextForGLES2Interface(gpu::gles2::GLES2Interface* gl); | 
| 27   virtual ~GrContextForGLES2Interface(); | 27   virtual ~GrContextForGLES2Interface(); | 
| 28 | 28 | 
| 29   GrContext* get() { return gr_context_.get(); } | 29   GrContext* get() { return gr_context_.get(); } | 
| 30 | 30 | 
| 31   void OnLostContext(); | 31   void OnLostContext(); | 
| 32   void FreeGpuResources(); | 32   void FreeGpuResources(); | 
| 33 | 33 | 
| 34  private: | 34  private: | 
| 35   skia::RefPtr<class GrContext> gr_context_; | 35   sk_sp<class GrContext> gr_context_; | 
| 36 | 36 | 
| 37   DISALLOW_COPY_AND_ASSIGN(GrContextForGLES2Interface); | 37   DISALLOW_COPY_AND_ASSIGN(GrContextForGLES2Interface); | 
| 38 }; | 38 }; | 
| 39 | 39 | 
| 40 }  // namespace content | 40 }  // namespace content | 
| 41 | 41 | 
| 42 #endif  // CONTENT_COMMON_GPU_CLIENT_GRCONTEXT_FOR_GLES2_INTERFACE_H_ | 42 #endif  // CONTENT_COMMON_GPU_CLIENT_GRCONTEXT_FOR_GLES2_INTERFACE_H_ | 
| OLD | NEW | 
|---|