| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "mojo/services/gles2/command_buffer_impl.h" | 5 #include "mojo/services/gles2/command_buffer_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" |
| 8 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
| 9 | |
| 10 #include "gpu/command_buffer/common/constants.h" | 10 #include "gpu/command_buffer/common/constants.h" |
| 11 #include "gpu/command_buffer/service/command_buffer_service.h" | 11 #include "gpu/command_buffer/service/command_buffer_service.h" |
| 12 #include "gpu/command_buffer/service/context_group.h" | 12 #include "gpu/command_buffer/service/context_group.h" |
| 13 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 13 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 14 #include "gpu/command_buffer/service/gpu_scheduler.h" | 14 #include "gpu/command_buffer/service/gpu_scheduler.h" |
| 15 #include "gpu/command_buffer/service/image_manager.h" | 15 #include "gpu/command_buffer/service/image_manager.h" |
| 16 #include "gpu/command_buffer/service/mailbox_manager.h" | 16 #include "gpu/command_buffer/service/mailbox_manager.h" |
| 17 #include "gpu/command_buffer/service/memory_tracking.h" | 17 #include "gpu/command_buffer/service/memory_tracking.h" |
| 18 #include "mojo/services/gles2/command_buffer_type_conversions.h" | 18 #include "mojo/services/gles2/command_buffer_type_conversions.h" |
| 19 #include "mojo/services/gles2/mojo_buffer_backing.h" | 19 #include "mojo/services/gles2/mojo_buffer_backing.h" |
| 20 #include "ui/gl/gl_context.h" | 20 #include "ui/gl/gl_context.h" |
| 21 #include "ui/gl/gl_surface.h" | 21 #include "ui/gl/gl_surface.h" |
| 22 | 22 |
| 23 namespace mojo { | 23 namespace mojo { |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 class MemoryTrackerStub : public gpu::gles2::MemoryTracker { | 27 class MemoryTrackerStub : public gpu::gles2::MemoryTracker { |
| 28 public: | 28 public: |
| 29 MemoryTrackerStub() {} | 29 MemoryTrackerStub() {} |
| 30 | 30 |
| 31 virtual void TrackMemoryAllocatedChange(size_t old_size, | 31 virtual void TrackMemoryAllocatedChange(size_t old_size, |
| 32 size_t new_size, | 32 size_t new_size, |
| 33 gpu::gles2::MemoryTracker::Pool pool) | 33 gpu::gles2::MemoryTracker::Pool pool) |
| 34 OVERRIDE {} | 34 override {} |
| 35 | 35 |
| 36 virtual bool EnsureGPUMemoryAvailable(size_t size_needed) OVERRIDE { | 36 virtual bool EnsureGPUMemoryAvailable(size_t size_needed) override { |
| 37 return true; | 37 return true; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 virtual ~MemoryTrackerStub() {} | 41 virtual ~MemoryTrackerStub() {} |
| 42 | 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(MemoryTrackerStub); | 43 DISALLOW_COPY_AND_ASSIGN(MemoryTrackerStub); |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 } // anonymous namespace | 46 } // anonymous namespace |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 void CommandBufferImpl::OnParseError() { | 195 void CommandBufferImpl::OnParseError() { |
| 196 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); | 196 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); |
| 197 client()->LostContext(state.context_lost_reason); | 197 client()->LostContext(state.context_lost_reason); |
| 198 } | 198 } |
| 199 | 199 |
| 200 void CommandBufferImpl::OnResize(gfx::Size size, float scale_factor) { | 200 void CommandBufferImpl::OnResize(gfx::Size size, float scale_factor) { |
| 201 surface_->Resize(size); | 201 surface_->Resize(size); |
| 202 } | 202 } |
| 203 | 203 |
| 204 } // namespace mojo | 204 } // namespace mojo |
| OLD | NEW |