OLD | NEW |
---|---|
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/renderbuffer_manager.h" | 5 #include "gpu/command_buffer/service/renderbuffer_manager.h" |
6 #include "base/debug/trace_event.h" | 6 #include "base/debug/trace_event.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
10 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 10 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
(...skipping 30 matching lines...) Expand all Loading... | |
41 size_t Renderbuffer::EstimatedSize() { | 41 size_t Renderbuffer::EstimatedSize() { |
42 uint32 size = 0; | 42 uint32 size = 0; |
43 manager_->ComputeEstimatedRenderbufferSize( | 43 manager_->ComputeEstimatedRenderbufferSize( |
44 width_, height_, samples_, internal_format_, &size); | 44 width_, height_, samples_, internal_format_, &size); |
45 return size; | 45 return size; |
46 } | 46 } |
47 | 47 |
48 void Renderbuffer::AddToSignature( | 48 void Renderbuffer::AddToSignature( |
49 std::string* signature) const { | 49 std::string* signature) const { |
50 DCHECK(signature); | 50 DCHECK(signature); |
51 *signature += base::StringPrintf( | 51 signature->append("|Renderbuffer|"); |
52 "|Renderbuffer|internal_format=%04x|samples=%d|width=%d|height=%d", | 52 signature->append(reinterpret_cast<const char*>(&internal_format_), |
53 internal_format_, samples_, width_, height_); | 53 sizeof(internal_format_)); |
54 signature->append(reinterpret_cast<const char*>(&samples_), sizeof(samples_)); | |
55 signature->append(reinterpret_cast<const char*>(&width_), sizeof(width_)); | |
56 signature->append(reinterpret_cast<const char*>(&height_), sizeof(height_)); | |
vmiura
2014/09/23 20:26:47
Could this be improved by packing the values in a
David Yen
2014/09/23 20:45:24
I'll create a structure to do this.
| |
54 } | 57 } |
55 | 58 |
56 Renderbuffer::Renderbuffer(RenderbufferManager* manager, | 59 Renderbuffer::Renderbuffer(RenderbufferManager* manager, |
57 GLuint client_id, | 60 GLuint client_id, |
58 GLuint service_id) | 61 GLuint service_id) |
59 : manager_(manager), | 62 : manager_(manager), |
60 client_id_(client_id), | 63 client_id_(client_id), |
61 service_id_(service_id), | 64 service_id_(service_id), |
62 cleared_(true), | 65 cleared_(true), |
63 has_been_bound_(false), | 66 has_been_bound_(false), |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
191 if (impl_format == GL_DEPTH_COMPONENT16 && depth24_supported_) | 194 if (impl_format == GL_DEPTH_COMPONENT16 && depth24_supported_) |
192 return GL_DEPTH_COMPONENT24; | 195 return GL_DEPTH_COMPONENT24; |
193 } | 196 } |
194 return impl_format; | 197 return impl_format; |
195 } | 198 } |
196 | 199 |
197 } // namespace gles2 | 200 } // namespace gles2 |
198 } // namespace gpu | 201 } // namespace gpu |
199 | 202 |
200 | 203 |
OLD | NEW |