| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 const gfx::ColorSpace& color_space, |
| 219 bool has_alpha) { | 219 bool has_alpha) { |
| 220 color_space_ = color_space; |
| 220 if (size == surface_size_ && scale_factor == device_scale_factor_ && | 221 if (size == surface_size_ && scale_factor == device_scale_factor_ && |
| 221 has_alpha == has_alpha_) | 222 has_alpha == has_alpha_) |
| 222 return; | 223 return; |
| 223 | 224 |
| 224 surface_size_ = size; | 225 surface_size_ = size; |
| 225 device_scale_factor_ = scale_factor; | 226 device_scale_factor_ = scale_factor; |
| 226 has_alpha_ = has_alpha; | 227 has_alpha_ = has_alpha; |
| 227 if (context_provider_.get()) { | 228 if (context_provider_.get()) { |
| 228 context_provider_->ContextGL()->ResizeCHROMIUM(size.width(), size.height(), | 229 context_provider_->ContextGL()->ResizeCHROMIUM(size.width(), size.height(), |
| 229 scale_factor, has_alpha); | 230 scale_factor, has_alpha); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 if (context_provider_.get()) { | 335 if (context_provider_.get()) { |
| 335 context_provider_->SetLostContextCallback( | 336 context_provider_->SetLostContextCallback( |
| 336 ContextProvider::LostContextCallback()); | 337 ContextProvider::LostContextCallback()); |
| 337 } | 338 } |
| 338 context_provider_ = nullptr; | 339 context_provider_ = nullptr; |
| 339 client_ = nullptr; | 340 client_ = nullptr; |
| 340 weak_ptr_factory_.InvalidateWeakPtrs(); | 341 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 341 } | 342 } |
| 342 | 343 |
| 343 } // namespace cc | 344 } // namespace cc |
| OLD | NEW |