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

Side by Side Diff: gpu/command_buffer/service/command_buffer_service.cc

Issue 706203003: Update from https://crrev.com/303153 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "gpu/command_buffer/service/command_buffer_service.h" 5 #include "gpu/command_buffer/service/command_buffer_service.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 21 matching lines...) Expand all
32 32
33 CommandBufferService::~CommandBufferService() { 33 CommandBufferService::~CommandBufferService() {
34 } 34 }
35 35
36 bool CommandBufferService::Initialize() { 36 bool CommandBufferService::Initialize() {
37 return true; 37 return true;
38 } 38 }
39 39
40 CommandBufferService::State CommandBufferService::GetLastState() { 40 CommandBufferService::State CommandBufferService::GetLastState() {
41 State state; 41 State state;
42 state.num_entries = num_entries_;
43 state.get_offset = get_offset_; 42 state.get_offset = get_offset_;
44 state.put_offset = put_offset_;
45 state.token = token_; 43 state.token = token_;
46 state.error = error_; 44 state.error = error_;
47 state.context_lost_reason = context_lost_reason_; 45 state.context_lost_reason = context_lost_reason_;
48 state.generation = ++generation_; 46 state.generation = ++generation_;
49 47
50 return state; 48 return state;
51 } 49 }
52 50
53 int32 CommandBufferService::GetLastToken() { 51 int32 CommandBufferService::GetLastToken() {
54 return GetLastState().token; 52 return GetLastState().token;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 if (!parse_error_callback_.is_null()) 165 if (!parse_error_callback_.is_null())
168 parse_error_callback_.Run(); 166 parse_error_callback_.Run();
169 } 167 }
170 } 168 }
171 169
172 void CommandBufferService::SetContextLostReason( 170 void CommandBufferService::SetContextLostReason(
173 error::ContextLostReason reason) { 171 error::ContextLostReason reason) {
174 context_lost_reason_ = reason; 172 context_lost_reason_ = reason;
175 } 173 }
176 174
175 int32 CommandBufferService::GetPutOffset() {
176 return put_offset_;
177 }
178
177 void CommandBufferService::SetPutOffsetChangeCallback( 179 void CommandBufferService::SetPutOffsetChangeCallback(
178 const base::Closure& callback) { 180 const base::Closure& callback) {
179 put_offset_change_callback_ = callback; 181 put_offset_change_callback_ = callback;
180 } 182 }
181 183
182 void CommandBufferService::SetGetBufferChangeCallback( 184 void CommandBufferService::SetGetBufferChangeCallback(
183 const GetBufferChangedCallback& callback) { 185 const GetBufferChangedCallback& callback) {
184 get_buffer_change_callback_ = callback; 186 get_buffer_change_callback_ = callback;
185 } 187 }
186 188
187 void CommandBufferService::SetParseErrorCallback( 189 void CommandBufferService::SetParseErrorCallback(
188 const base::Closure& callback) { 190 const base::Closure& callback) {
189 parse_error_callback_ = callback; 191 parse_error_callback_ = callback;
190 } 192 }
191 193
192 } // namespace gpu 194 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/command_buffer_service.h ('k') | gpu/command_buffer/service/command_buffer_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698