| 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 "gpu/skia_bindings/grcontext_for_gles2_interface.h" | 5 #include "gpu/skia_bindings/grcontext_for_gles2_interface.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/sys_info.h" | 13 #include "base/sys_info.h" |
| 14 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
| 15 #include "gpu/command_buffer/client/gles2_interface.h" | 15 #include "gpu/command_buffer/client/gles2_interface.h" |
| 16 #include "gpu/command_buffer/common/capabilities.h" | 16 #include "gpu/command_buffer/common/capabilities.h" |
| 17 #include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h" | 17 #include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h" |
| 18 #include "third_party/skia/include/gpu/GrContext.h" | 18 #include "third_party/skia/include/gpu/GrContext.h" |
| 19 #include "third_party/skia/include/gpu/GrContextOptions.h" |
| 19 #include "third_party/skia/include/gpu/gl/GrGLInterface.h" | 20 #include "third_party/skia/include/gpu/gl/GrGLInterface.h" |
| 20 | 21 |
| 21 namespace skia_bindings { | 22 namespace skia_bindings { |
| 22 | 23 |
| 23 GrContextForGLES2Interface::GrContextForGLES2Interface( | 24 GrContextForGLES2Interface::GrContextForGLES2Interface( |
| 24 gpu::gles2::GLES2Interface* gl, | 25 gpu::gles2::GLES2Interface* gl, |
| 25 const gpu::Capabilities& capabilities) { | 26 const gpu::Capabilities& capabilities) { |
| 26 GrContextOptions options; | 27 GrContextOptions options; |
| 27 options.fAvoidStencilBuffers = capabilities.avoid_stencil_buffers; | 28 options.fAvoidStencilBuffers = capabilities.avoid_stencil_buffers; |
| 28 sk_sp<GrGLInterface> interface( | 29 sk_sp<GrGLInterface> interface( |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 76 |
| 76 void GrContextForGLES2Interface::FreeGpuResources() { | 77 void GrContextForGLES2Interface::FreeGpuResources() { |
| 77 if (gr_context_) { | 78 if (gr_context_) { |
| 78 TRACE_EVENT_INSTANT0("gpu", "GrContext::freeGpuResources", | 79 TRACE_EVENT_INSTANT0("gpu", "GrContext::freeGpuResources", |
| 79 TRACE_EVENT_SCOPE_THREAD); | 80 TRACE_EVENT_SCOPE_THREAD); |
| 80 gr_context_->freeGpuResources(); | 81 gr_context_->freeGpuResources(); |
| 81 } | 82 } |
| 82 } | 83 } |
| 83 | 84 |
| 84 } // namespace skia_bindings | 85 } // namespace skia_bindings |
| OLD | NEW |