OLD | NEW |
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 "cc/output/output_surface.h" | 5 #include "cc/output/output_surface.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 void OutputSurface::DiscardBackbuffer() { | 209 void OutputSurface::DiscardBackbuffer() { |
210 if (context_provider_.get()) | 210 if (context_provider_.get()) |
211 context_provider_->ContextGL()->DiscardBackbufferCHROMIUM(); | 211 context_provider_->ContextGL()->DiscardBackbufferCHROMIUM(); |
212 if (software_device_) | 212 if (software_device_) |
213 software_device_->DiscardBackbuffer(); | 213 software_device_->DiscardBackbuffer(); |
214 } | 214 } |
215 | 215 |
216 void OutputSurface::Reshape(const gfx::Size& size, | 216 void OutputSurface::Reshape(const gfx::Size& size, |
217 float scale_factor, | 217 float scale_factor, |
| 218 const gfx::ColorSpace& color_space, |
218 bool has_alpha) { | 219 bool has_alpha) { |
219 if (size == surface_size_ && scale_factor == device_scale_factor_ && | 220 if (size == surface_size_ && scale_factor == device_scale_factor_ && |
220 has_alpha == has_alpha_) | 221 has_alpha == has_alpha_) |
221 return; | 222 return; |
222 | 223 |
223 surface_size_ = size; | 224 surface_size_ = size; |
224 device_scale_factor_ = scale_factor; | 225 device_scale_factor_ = scale_factor; |
225 has_alpha_ = has_alpha; | 226 has_alpha_ = has_alpha; |
226 if (context_provider_.get()) { | 227 if (context_provider_.get()) { |
227 context_provider_->ContextGL()->ResizeCHROMIUM(size.width(), size.height(), | 228 context_provider_->ContextGL()->ResizeCHROMIUM(size.width(), size.height(), |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 if (context_provider_.get()) { | 334 if (context_provider_.get()) { |
334 context_provider_->SetLostContextCallback( | 335 context_provider_->SetLostContextCallback( |
335 ContextProvider::LostContextCallback()); | 336 ContextProvider::LostContextCallback()); |
336 } | 337 } |
337 context_provider_ = nullptr; | 338 context_provider_ = nullptr; |
338 client_ = nullptr; | 339 client_ = nullptr; |
339 weak_ptr_factory_.InvalidateWeakPtrs(); | 340 weak_ptr_factory_.InvalidateWeakPtrs(); |
340 } | 341 } |
341 | 342 |
342 } // namespace cc | 343 } // namespace cc |
OLD | NEW |