OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
6 | 6 |
7 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" | 7 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" |
8 | 8 |
9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
10 #ifndef GL_GLEXT_PROTOTYPES | 10 #ifndef GL_GLEXT_PROTOTYPES |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 if (!context_->GetChildToParentLatch(latch_id)) { | 360 if (!context_->GetChildToParentLatch(latch_id)) { |
361 LOG(ERROR) << "getLatch must only be called on child context"; | 361 LOG(ERROR) << "getLatch must only be called on child context"; |
362 synthesizeGLError(GL_INVALID_OPERATION); | 362 synthesizeGLError(GL_INVALID_OPERATION); |
363 *latch_id = gpu::kInvalidLatchId; | 363 *latch_id = gpu::kInvalidLatchId; |
364 } | 364 } |
365 } | 365 } |
366 | 366 |
367 void WebGraphicsContext3DCommandBufferImpl::waitLatchCHROMIUM( | 367 void WebGraphicsContext3DCommandBufferImpl::waitLatchCHROMIUM( |
368 WGC3Duint latch_id) | 368 WGC3Duint latch_id) |
369 { | 369 { |
370 TRACE_EVENT1("gpu", "WebGfxCtx3DCmdBfrImpl::WaitLatch", "latch_id", latch_id); | |
371 gl_->WaitLatchCHROMIUM(latch_id); | |
372 } | 370 } |
373 | 371 |
374 void WebGraphicsContext3DCommandBufferImpl::setLatchCHROMIUM( | 372 void WebGraphicsContext3DCommandBufferImpl::setLatchCHROMIUM( |
375 WGC3Duint latch_id) | 373 WGC3Duint latch_id) |
376 { | 374 { |
377 TRACE_EVENT1("gpu", "WebGfxCtx3DCmdBfrImpl::SetLatch", "latch_id", latch_id); | |
378 gl_->SetLatchCHROMIUM(latch_id); | |
379 // required to ensure set command is sent to GPU process | |
380 gl_->Flush(); | |
381 } | 375 } |
382 | 376 |
383 void WebGraphicsContext3DCommandBufferImpl:: | 377 void WebGraphicsContext3DCommandBufferImpl:: |
384 rateLimitOffscreenContextCHROMIUM() { | 378 rateLimitOffscreenContextCHROMIUM() { |
385 gl_->RateLimitOffscreenContextCHROMIUM(); | 379 gl_->RateLimitOffscreenContextCHROMIUM(); |
386 } | 380 } |
387 | 381 |
388 WebKit::WebString WebGraphicsContext3DCommandBufferImpl:: | 382 WebKit::WebString WebGraphicsContext3DCommandBufferImpl:: |
389 getRequestableExtensionsCHROMIUM() { | 383 getRequestableExtensionsCHROMIUM() { |
390 return WebKit::WebString::fromUTF8( | 384 return WebKit::WebString::fromUTF8( |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 context_lost_callback_->onContextLost(); | 1027 context_lost_callback_->onContextLost(); |
1034 } | 1028 } |
1035 | 1029 |
1036 RenderView* renderview = | 1030 RenderView* renderview = |
1037 web_view_ ? RenderView::FromWebView(web_view_) : NULL; | 1031 web_view_ ? RenderView::FromWebView(web_view_) : NULL; |
1038 if (renderview) | 1032 if (renderview) |
1039 renderview->OnViewContextSwapBuffersAborted(); | 1033 renderview->OnViewContextSwapBuffersAborted(); |
1040 } | 1034 } |
1041 | 1035 |
1042 #endif // defined(ENABLE_GPU) | 1036 #endif // defined(ENABLE_GPU) |
OLD | NEW |