| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/webgraphicscontext3d_impl.h" | 5 #include "webkit/common/gpu/webgraphicscontext3d_impl.h" |
| 6 | 6 |
| 7 #include "base/atomicops.h" | 7 #include "base/atomicops.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "gpu/GLES2/gl2extchromium.h" | 10 #include "gpu/GLES2/gl2extchromium.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 163 |
| 164 } | 164 } |
| 165 | 165 |
| 166 void WebGraphicsContext3DImpl::synthesizeGLError(WGC3Denum error) { | 166 void WebGraphicsContext3DImpl::synthesizeGLError(WGC3Denum error) { |
| 167 if (std::find(synthetic_errors_.begin(), synthetic_errors_.end(), error) == | 167 if (std::find(synthetic_errors_.begin(), synthetic_errors_.end(), error) == |
| 168 synthetic_errors_.end()) { | 168 synthetic_errors_.end()) { |
| 169 synthetic_errors_.push_back(error); | 169 synthetic_errors_.push_back(error); |
| 170 } | 170 } |
| 171 } | 171 } |
| 172 | 172 |
| 173 bool WebGraphicsContext3DImpl::makeContextCurrent() { |
| 174 return true; |
| 175 } |
| 176 |
| 173 uint32_t WebGraphicsContext3DImpl::lastFlushID() { | 177 uint32_t WebGraphicsContext3DImpl::lastFlushID() { |
| 174 return flush_id_; | 178 return flush_id_; |
| 175 } | 179 } |
| 176 | 180 |
| 177 DELEGATE_TO_GL_R(insertSyncPoint, InsertSyncPointCHROMIUM, unsigned int) | 181 DELEGATE_TO_GL_R(insertSyncPoint, InsertSyncPointCHROMIUM, unsigned int) |
| 178 | 182 |
| 179 DELEGATE_TO_GL_3(reshapeWithScaleFactor, ResizeCHROMIUM, int, int, float) | 183 DELEGATE_TO_GL_3(reshapeWithScaleFactor, ResizeCHROMIUM, int, int, float) |
| 180 | 184 |
| 181 DELEGATE_TO_GL_4R(mapBufferSubDataCHROMIUM, MapBufferSubDataCHROMIUM, WGC3Denum, | 185 DELEGATE_TO_GL_4R(mapBufferSubDataCHROMIUM, MapBufferSubDataCHROMIUM, WGC3Denum, |
| 182 WGC3Dintptr, WGC3Dsizeiptr, WGC3Denum, void*) | 186 WGC3Dintptr, WGC3Dsizeiptr, WGC3Denum, void*) |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 | 934 |
| 931 DELEGATE_TO_GL_6(framebufferTexture2DMultisampleEXT, | 935 DELEGATE_TO_GL_6(framebufferTexture2DMultisampleEXT, |
| 932 FramebufferTexture2DMultisampleEXT, | 936 FramebufferTexture2DMultisampleEXT, |
| 933 WGC3Denum, WGC3Denum, WGC3Denum, WebGLId, WGC3Dint, WGC3Dsizei) | 937 WGC3Denum, WGC3Denum, WGC3Denum, WebGLId, WGC3Dint, WGC3Dsizei) |
| 934 | 938 |
| 935 DELEGATE_TO_GL_5(renderbufferStorageMultisampleEXT, | 939 DELEGATE_TO_GL_5(renderbufferStorageMultisampleEXT, |
| 936 RenderbufferStorageMultisampleEXT, WGC3Denum, WGC3Dsizei, | 940 RenderbufferStorageMultisampleEXT, WGC3Denum, WGC3Dsizei, |
| 937 WGC3Denum, WGC3Dsizei, WGC3Dsizei) | 941 WGC3Denum, WGC3Dsizei, WGC3Dsizei) |
| 938 | 942 |
| 939 GrGLInterface* WebGraphicsContext3DImpl::createGrGLInterface() { | 943 GrGLInterface* WebGraphicsContext3DImpl::createGrGLInterface() { |
| 940 makeContextCurrent(); | |
| 941 return skia_bindings::CreateCommandBufferSkiaGLBinding(); | 944 return skia_bindings::CreateCommandBufferSkiaGLBinding(); |
| 942 } | 945 } |
| 943 | 946 |
| 944 ::gpu::gles2::GLES2ImplementationErrorMessageCallback* | 947 ::gpu::gles2::GLES2ImplementationErrorMessageCallback* |
| 945 WebGraphicsContext3DImpl::getErrorMessageCallback() { | 948 WebGraphicsContext3DImpl::getErrorMessageCallback() { |
| 946 if (!client_error_message_callback_) { | 949 if (!client_error_message_callback_) { |
| 947 client_error_message_callback_.reset( | 950 client_error_message_callback_.reset( |
| 948 new WebGraphicsContext3DErrorMessageCallback(this)); | 951 new WebGraphicsContext3DErrorMessageCallback(this)); |
| 949 } | 952 } |
| 950 return client_error_message_callback_.get(); | 953 return client_error_message_callback_.get(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 output_attribs->stencil_size = attributes.stencil ? 8 : 0; | 993 output_attribs->stencil_size = attributes.stencil ? 8 : 0; |
| 991 output_attribs->samples = attributes.antialias ? 4 : 0; | 994 output_attribs->samples = attributes.antialias ? 4 : 0; |
| 992 output_attribs->sample_buffers = attributes.antialias ? 1 : 0; | 995 output_attribs->sample_buffers = attributes.antialias ? 1 : 0; |
| 993 output_attribs->fail_if_major_perf_caveat = | 996 output_attribs->fail_if_major_perf_caveat = |
| 994 attributes.failIfMajorPerformanceCaveat; | 997 attributes.failIfMajorPerformanceCaveat; |
| 995 output_attribs->bind_generates_resource = false; | 998 output_attribs->bind_generates_resource = false; |
| 996 } | 999 } |
| 997 | 1000 |
| 998 } // namespace gpu | 1001 } // namespace gpu |
| 999 } // namespace webkit | 1002 } // namespace webkit |
| OLD | NEW |