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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 software_device_->DiscardBackbuffer(); | 250 software_device_->DiscardBackbuffer(); |
251 } | 251 } |
252 | 252 |
253 void OutputSurface::Reshape(const gfx::Size& size, float scale_factor) { | 253 void OutputSurface::Reshape(const gfx::Size& size, float scale_factor) { |
254 if (size == surface_size_ && scale_factor == device_scale_factor_) | 254 if (size == surface_size_ && scale_factor == device_scale_factor_) |
255 return; | 255 return; |
256 | 256 |
257 surface_size_ = size; | 257 surface_size_ = size; |
258 device_scale_factor_ = scale_factor; | 258 device_scale_factor_ = scale_factor; |
259 if (context_provider_.get()) { | 259 if (context_provider_.get()) { |
260 context_provider_->ContextGL()->ResizeCHROMIUM( | 260 context_provider_->ContextGL()->ResizeCHROMIUM(size.width(), size.height(), |
261 size.width(), size.height(), scale_factor); | 261 scale_factor, GL_TRUE); |
262 } | 262 } |
263 if (software_device_) | 263 if (software_device_) |
264 software_device_->Resize(size, scale_factor); | 264 software_device_->Resize(size, scale_factor); |
265 } | 265 } |
266 | 266 |
267 void OutputSurface::BindFramebuffer() { | 267 void OutputSurface::BindFramebuffer() { |
268 DCHECK(context_provider_.get()); | 268 DCHECK(context_provider_.get()); |
269 context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); | 269 context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); |
270 } | 270 } |
271 | 271 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 if (context_provider_.get()) { | 361 if (context_provider_.get()) { |
362 context_provider_->SetLostContextCallback( | 362 context_provider_->SetLostContextCallback( |
363 ContextProvider::LostContextCallback()); | 363 ContextProvider::LostContextCallback()); |
364 } | 364 } |
365 context_provider_ = nullptr; | 365 context_provider_ = nullptr; |
366 client_ = nullptr; | 366 client_ = nullptr; |
367 weak_ptr_factory_.InvalidateWeakPtrs(); | 367 weak_ptr_factory_.InvalidateWeakPtrs(); |
368 } | 368 } |
369 | 369 |
370 } // namespace cc | 370 } // namespace cc |
OLD | NEW |