Chromium Code Reviews| Index: content/renderer/gpu/compositor_software_output_device.cc |
| diff --git a/content/renderer/gpu/compositor_software_output_device.cc b/content/renderer/gpu/compositor_software_output_device.cc |
| index b7718fc8064dd73c0b9aebe70a28423956ebf7d2..a9ca113b117e8a8934753a43c89e13220e6e38f0 100644 |
| --- a/content/renderer/gpu/compositor_software_output_device.cc |
| +++ b/content/renderer/gpu/compositor_software_output_device.cc |
| @@ -15,6 +15,12 @@ |
| #include "third_party/skia/include/core/SkRegion.h" |
| #include "ui/gfx/skia_util.h" |
| +namespace { |
| + |
| +static const size_t kInvalidIndex = static_cast<size_t>(-1); |
|
jamesr
2014/07/07 22:48:07
the anonymous namespace and the 'static' are redun
Peter Kasting
2014/07/07 22:52:18
Yes. Sorry. Dropping the "static".
|
| + |
| +} // namespace |
| + |
| namespace content { |
| CompositorSoftwareOutputDevice::Buffer::Buffer( |
| @@ -56,7 +62,7 @@ bool CompositorSoftwareOutputDevice::Buffer::FindDamageDifferenceFrom( |
| } |
| CompositorSoftwareOutputDevice::CompositorSoftwareOutputDevice() |
| - : current_index_(-1), |
| + : current_index_(kInvalidIndex), |
| next_buffer_id_(1), |
| shared_bitmap_manager_( |
| RenderThreadImpl::current()->shared_bitmap_manager()) { |
| @@ -113,7 +119,7 @@ void CompositorSoftwareOutputDevice::Resize( |
| } |
| buffers_.clear(); |
| - current_index_ = -1; |
| + current_index_ = kInvalidIndex; |
| viewport_pixel_size_ = viewport_pixel_size; |
| } |
| @@ -126,7 +132,7 @@ void CompositorSoftwareOutputDevice::DiscardBackbuffer() { |
| } |
| } |
| buffers_.clear(); |
| - current_index_ = -1; |
| + current_index_ = kInvalidIndex; |
| } |
| void CompositorSoftwareOutputDevice::EnsureBackbuffer() { |
| @@ -137,7 +143,7 @@ SkCanvas* CompositorSoftwareOutputDevice::BeginPaint( |
| DCHECK(CalledOnValidThread()); |
| Buffer* previous = NULL; |
| - if (current_index_ != size_t(-1)) |
| + if (current_index_ != kInvalidIndex) |
| previous = buffers_[current_index_]; |
| current_index_ = FindFreeBuffer(current_index_ + 1); |
| Buffer* current = buffers_[current_index_]; |