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 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" | 8 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" |
9 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" | 9 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 class ContextProviderInProcess::MemoryAllocationCallbackProxy | 30 class ContextProviderInProcess::MemoryAllocationCallbackProxy |
31 : public WebKit::WebGraphicsContext3D:: | 31 : public WebKit::WebGraphicsContext3D:: |
32 WebGraphicsMemoryAllocationChangedCallbackCHROMIUM { | 32 WebGraphicsMemoryAllocationChangedCallbackCHROMIUM { |
33 public: | 33 public: |
34 explicit MemoryAllocationCallbackProxy(ContextProviderInProcess* provider) | 34 explicit MemoryAllocationCallbackProxy(ContextProviderInProcess* provider) |
35 : provider_(provider) { | 35 : provider_(provider) { |
36 provider_->context3d_->setMemoryAllocationChangedCallbackCHROMIUM(this); | 36 provider_->context3d_->setMemoryAllocationChangedCallbackCHROMIUM(this); |
37 } | 37 } |
38 | 38 |
39 void onMemoryAllocationChanged(WebKit::WebGraphicsMemoryAllocation alloc) { | 39 virtual void onMemoryAllocationChanged( |
| 40 WebKit::WebGraphicsMemoryAllocation alloc) { |
40 provider_->OnMemoryAllocationChanged(!!alloc.gpuResourceSizeInBytes); | 41 provider_->OnMemoryAllocationChanged(!!alloc.gpuResourceSizeInBytes); |
41 } | 42 } |
42 | 43 |
43 private: | 44 private: |
44 ContextProviderInProcess* provider_; | 45 ContextProviderInProcess* provider_; |
45 }; | 46 }; |
46 | 47 |
47 ContextProviderInProcess::ContextProviderInProcess(InProcessType type) | 48 ContextProviderInProcess::ContextProviderInProcess(InProcessType type) |
48 : type_(type), | 49 : type_(type), |
49 destroyed_(false) { | 50 destroyed_(false) { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 return CreateInProcessImpl(attributes).Pass(); | 140 return CreateInProcessImpl(attributes).Pass(); |
140 case IN_PROCESS_COMMAND_BUFFER: | 141 case IN_PROCESS_COMMAND_BUFFER: |
141 return CreateCommandBufferImpl(attributes).Pass(); | 142 return CreateCommandBufferImpl(attributes).Pass(); |
142 } | 143 } |
143 NOTREACHED(); | 144 NOTREACHED(); |
144 return CreateInProcessImpl(attributes).Pass(); | 145 return CreateInProcessImpl(attributes).Pass(); |
145 } | 146 } |
146 | 147 |
147 } // namespace gpu | 148 } // namespace gpu |
148 } // namespace webkit | 149 } // namespace webkit |
OLD | NEW |