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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 void OutputSurface::DidLoseOutputSurface() { | 173 void OutputSurface::DidLoseOutputSurface() { |
174 TRACE_EVENT0("cc", "OutputSurface::DidLoseOutputSurface"); | 174 TRACE_EVENT0("cc", "OutputSurface::DidLoseOutputSurface"); |
175 client_->DidLoseOutputSurface(); | 175 client_->DidLoseOutputSurface(); |
176 } | 176 } |
177 | 177 |
178 void OutputSurface::SetExternalStencilTest(bool enabled) { | 178 void OutputSurface::SetExternalStencilTest(bool enabled) { |
179 external_stencil_test_enabled_ = enabled; | 179 external_stencil_test_enabled_ = enabled; |
180 } | 180 } |
181 | 181 |
182 void OutputSurface::SetExternalDrawConstraints( | |
183 const gfx::Transform& transform, | |
184 const gfx::Rect& viewport, | |
185 const gfx::Rect& clip, | |
186 const gfx::Rect& viewport_rect_for_tile_priority, | |
187 const gfx::Transform& transform_for_tile_priority, | |
188 bool resourceless_software_draw) { | |
189 client_->SetExternalDrawConstraints(transform, | |
190 viewport, | |
191 clip, | |
192 viewport_rect_for_tile_priority, | |
193 transform_for_tile_priority, | |
194 resourceless_software_draw); | |
195 } | |
196 | |
197 OutputSurface::~OutputSurface() { | 182 OutputSurface::~OutputSurface() { |
198 if (client_) | 183 if (client_) |
199 DetachFromClientInternal(); | 184 DetachFromClientInternal(); |
200 } | 185 } |
201 | 186 |
202 bool OutputSurface::HasExternalStencilTest() const { | 187 bool OutputSurface::HasExternalStencilTest() const { |
203 return external_stencil_test_enabled_; | 188 return external_stencil_test_enabled_; |
204 } | 189 } |
205 | 190 |
206 bool OutputSurface::BindToClient(OutputSurfaceClient* client) { | 191 bool OutputSurface::BindToClient(OutputSurfaceClient* client) { |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 if (context_provider_.get()) { | 351 if (context_provider_.get()) { |
367 context_provider_->SetLostContextCallback( | 352 context_provider_->SetLostContextCallback( |
368 ContextProvider::LostContextCallback()); | 353 ContextProvider::LostContextCallback()); |
369 } | 354 } |
370 context_provider_ = nullptr; | 355 context_provider_ = nullptr; |
371 client_ = nullptr; | 356 client_ = nullptr; |
372 weak_ptr_factory_.InvalidateWeakPtrs(); | 357 weak_ptr_factory_.InvalidateWeakPtrs(); |
373 } | 358 } |
374 | 359 |
375 } // namespace cc | 360 } // namespace cc |
OLD | NEW |