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 <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 void OutputSurface::DidLoseOutputSurface() { | 85 void OutputSurface::DidLoseOutputSurface() { |
86 TRACE_EVENT0("cc", "OutputSurface::DidLoseOutputSurface"); | 86 TRACE_EVENT0("cc", "OutputSurface::DidLoseOutputSurface"); |
87 client_->DidLoseOutputSurface(); | 87 client_->DidLoseOutputSurface(); |
88 } | 88 } |
89 | 89 |
90 void OutputSurface::SetExternalStencilTest(bool enabled) { | 90 void OutputSurface::SetExternalStencilTest(bool enabled) { |
91 external_stencil_test_enabled_ = enabled; | 91 external_stencil_test_enabled_ = enabled; |
92 } | 92 } |
93 | 93 |
94 void OutputSurface::SetExternalDrawConstraints(const gfx::Transform& transform, | 94 void OutputSurface::SetExternalDrawConstraints( |
95 const gfx::Rect& viewport, | 95 const gfx::Transform& transform, |
96 const gfx::Rect& clip, | 96 const gfx::Rect& viewport, |
97 bool valid_for_tile_management) { | 97 const gfx::Rect& clip, |
| 98 bool resourceless_software_draw) { |
98 client_->SetExternalDrawConstraints( | 99 client_->SetExternalDrawConstraints( |
99 transform, viewport, clip, valid_for_tile_management); | 100 transform, viewport, clip, resourceless_software_draw); |
100 } | 101 } |
101 | 102 |
102 OutputSurface::~OutputSurface() { | 103 OutputSurface::~OutputSurface() { |
103 ResetContext3d(); | 104 ResetContext3d(); |
104 } | 105 } |
105 | 106 |
106 bool OutputSurface::HasExternalStencilTest() const { | 107 bool OutputSurface::HasExternalStencilTest() const { |
107 return external_stencil_test_enabled_; | 108 return external_stencil_test_enabled_; |
108 } | 109 } |
109 | 110 |
110 bool OutputSurface::ForcedDrawToSoftwareDevice() const { return false; } | |
111 | |
112 bool OutputSurface::BindToClient(OutputSurfaceClient* client) { | 111 bool OutputSurface::BindToClient(OutputSurfaceClient* client) { |
113 DCHECK(client); | 112 DCHECK(client); |
114 client_ = client; | 113 client_ = client; |
115 bool success = true; | 114 bool success = true; |
116 | 115 |
117 if (context_provider_) { | 116 if (context_provider_) { |
118 success = context_provider_->BindToCurrentThread(); | 117 success = context_provider_->BindToCurrentThread(); |
119 if (success) | 118 if (success) |
120 SetUpContext3d(); | 119 SetUpContext3d(); |
121 } | 120 } |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", | 258 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", |
260 "bytes_limit_when_visible", policy.bytes_limit_when_visible); | 259 "bytes_limit_when_visible", policy.bytes_limit_when_visible); |
261 // Just ignore the memory manager when it says to set the limit to zero | 260 // Just ignore the memory manager when it says to set the limit to zero |
262 // bytes. This will happen when the memory manager thinks that the renderer | 261 // bytes. This will happen when the memory manager thinks that the renderer |
263 // is not visible (which the renderer knows better). | 262 // is not visible (which the renderer knows better). |
264 if (policy.bytes_limit_when_visible) | 263 if (policy.bytes_limit_when_visible) |
265 client_->SetMemoryPolicy(policy); | 264 client_->SetMemoryPolicy(policy); |
266 } | 265 } |
267 | 266 |
268 } // namespace cc | 267 } // namespace cc |
OLD | NEW |