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