Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: content/common/gpu/client/context_provider_command_buffer.cc

Issue 12813004: Chromium style checker cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "content/common/gpu/client/context_provider_command_buffer.h" 5 #include "content/common/gpu/client/context_provider_command_buffer.h"
6 6
7 #include "webkit/gpu/grcontext_for_webgraphicscontext3d.h" 7 #include "webkit/gpu/grcontext_for_webgraphicscontext3d.h"
8 8
9 namespace content { 9 namespace content {
10 10
(...skipping 15 matching lines...) Expand all
26 26
27 class ContextProviderCommandBuffer::MemoryAllocationCallbackProxy 27 class ContextProviderCommandBuffer::MemoryAllocationCallbackProxy
28 : public WebKit::WebGraphicsContext3D:: 28 : public WebKit::WebGraphicsContext3D::
29 WebGraphicsMemoryAllocationChangedCallbackCHROMIUM { 29 WebGraphicsMemoryAllocationChangedCallbackCHROMIUM {
30 public: 30 public:
31 explicit MemoryAllocationCallbackProxy(ContextProviderCommandBuffer* provider) 31 explicit MemoryAllocationCallbackProxy(ContextProviderCommandBuffer* provider)
32 : provider_(provider) { 32 : provider_(provider) {
33 provider_->context3d_->setMemoryAllocationChangedCallbackCHROMIUM(this); 33 provider_->context3d_->setMemoryAllocationChangedCallbackCHROMIUM(this);
34 } 34 }
35 35
36 void onMemoryAllocationChanged(WebKit::WebGraphicsMemoryAllocation alloc) { 36 virtual void onMemoryAllocationChanged(
37 WebKit::WebGraphicsMemoryAllocation alloc) {
37 provider_->OnMemoryAllocationChanged(!!alloc.gpuResourceSizeInBytes); 38 provider_->OnMemoryAllocationChanged(!!alloc.gpuResourceSizeInBytes);
38 } 39 }
39 40
40 private: 41 private:
41 ContextProviderCommandBuffer* provider_; 42 ContextProviderCommandBuffer* provider_;
42 }; 43 };
43 44
44 ContextProviderCommandBuffer::ContextProviderCommandBuffer() 45 ContextProviderCommandBuffer::ContextProviderCommandBuffer()
45 : leak_on_destroy_(false), 46 : leak_on_destroy_(false),
46 destroyed_(false) { 47 destroyed_(false) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 return destroyed_; 110 return destroyed_;
110 } 111 }
111 112
112 void ContextProviderCommandBuffer::OnMemoryAllocationChanged( 113 void ContextProviderCommandBuffer::OnMemoryAllocationChanged(
113 bool nonzero_allocation) { 114 bool nonzero_allocation) {
114 if (gr_context_) 115 if (gr_context_)
115 gr_context_->SetMemoryLimit(nonzero_allocation); 116 gr_context_->SetMemoryLimit(nonzero_allocation);
116 } 117 }
117 118
118 } // namespace content 119 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698