| 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/gpu/context_provider_in_process.h" | 5 #include "webkit/gpu/context_provider_in_process.h" |
| 6 | 6 |
| 7 #include "webkit/gpu/grcontext_for_webgraphicscontext3d.h" | 7 #include "webkit/gpu/grcontext_for_webgraphicscontext3d.h" |
| 8 | 8 |
| 9 namespace webkit { | 9 namespace webkit { |
| 10 namespace gpu { | 10 namespace gpu { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 DCHECK(!context3d_); | 53 DCHECK(!context3d_); |
| 54 | 54 |
| 55 WebKit::WebGraphicsContext3D::Attributes attributes; | 55 WebKit::WebGraphicsContext3D::Attributes attributes; |
| 56 attributes.depth = false; | 56 attributes.depth = false; |
| 57 attributes.stencil = true; | 57 attributes.stencil = true; |
| 58 attributes.antialias = false; | 58 attributes.antialias = false; |
| 59 attributes.shareResources = true; | 59 attributes.shareResources = true; |
| 60 attributes.noAutomaticFlushes = true; | 60 attributes.noAutomaticFlushes = true; |
| 61 | 61 |
| 62 context3d_.reset( | 62 context3d_.reset( |
| 63 new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl()); | 63 new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl( |
| 64 if (!context3d_->Initialize(attributes, NULL)) | 64 attributes)); |
| 65 context3d_.reset(); | |
| 66 | 65 |
| 67 return context3d_; | 66 return context3d_; |
| 68 } | 67 } |
| 69 | 68 |
| 70 bool ContextProviderInProcess::BindToCurrentThread() { | 69 bool ContextProviderInProcess::BindToCurrentThread() { |
| 71 DCHECK(context3d_); | 70 DCHECK(context3d_); |
| 72 | 71 |
| 73 if (lost_context_callback_proxy_) | 72 if (lost_context_callback_proxy_) |
| 74 return true; | 73 return true; |
| 75 | 74 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 } | 124 } |
| 126 | 125 |
| 127 void ContextProviderInProcess::OnMemoryAllocationChanged( | 126 void ContextProviderInProcess::OnMemoryAllocationChanged( |
| 128 bool nonzero_allocation) { | 127 bool nonzero_allocation) { |
| 129 if (gr_context_) | 128 if (gr_context_) |
| 130 gr_context_->SetMemoryLimit(nonzero_allocation); | 129 gr_context_->SetMemoryLimit(nonzero_allocation); |
| 131 } | 130 } |
| 132 | 131 |
| 133 } // namespace gpu | 132 } // namespace gpu |
| 134 } // namespace webkit | 133 } // namespace webkit |
| OLD | NEW |