| 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 #include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h" | 5 #include "content/common/gpu/client/grcontext_for_webgraphicscontext3d.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "gpu/blink/webgraphicscontext3d_impl.h" | 9 #include "gpu/blink/webgraphicscontext3d_impl.h" |
| 10 #include "gpu/command_buffer/client/gles2_lib.h" | 10 #include "gpu/command_buffer/client/gles2_lib.h" |
| 11 #include "third_party/skia/include/gpu/GrContext.h" | 11 #include "third_party/skia/include/gpu/GrContext.h" |
| 12 #include "third_party/skia/include/gpu/gl/GrGLInterface.h" | 12 #include "third_party/skia/include/gpu/gl/GrGLInterface.h" |
| 13 | 13 |
| 14 using gpu_blink::WebGraphicsContext3DImpl; | 14 using gpu_blink::WebGraphicsContext3DImpl; |
| 15 | 15 |
| 16 namespace webkit { | 16 namespace content { |
| 17 namespace gpu { | |
| 18 | 17 |
| 19 namespace { | 18 namespace { |
| 20 | 19 |
| 21 // Singleton used to initialize and terminate the gles2 library. | 20 // Singleton used to initialize and terminate the gles2 library. |
| 22 class GLES2Initializer { | 21 class GLES2Initializer { |
| 23 public: | 22 public: |
| 24 GLES2Initializer() { gles2::Initialize(); } | 23 GLES2Initializer() { gles2::Initialize(); } |
| 25 | 24 |
| 26 ~GLES2Initializer() { gles2::Terminate(); } | 25 ~GLES2Initializer() { gles2::Terminate(); } |
| 27 | 26 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 } | 80 } |
| 82 | 81 |
| 83 void GrContextForWebGraphicsContext3D::FreeGpuResources() { | 82 void GrContextForWebGraphicsContext3D::FreeGpuResources() { |
| 84 if (gr_context_) { | 83 if (gr_context_) { |
| 85 TRACE_EVENT_INSTANT0("gpu", "GrContext::freeGpuResources", \ | 84 TRACE_EVENT_INSTANT0("gpu", "GrContext::freeGpuResources", \ |
| 86 TRACE_EVENT_SCOPE_THREAD); | 85 TRACE_EVENT_SCOPE_THREAD); |
| 87 gr_context_->freeGpuResources(); | 86 gr_context_->freeGpuResources(); |
| 88 } | 87 } |
| 89 } | 88 } |
| 90 | 89 |
| 91 } // namespace gpu | 90 } // namespace content |
| 92 } // namespace webkit | |
| OLD | NEW |