OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/software_renderer.h" | 5 #include "cc/output/software_renderer.h" |
6 | 6 |
7 #include "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
10 #include "cc/output/compositor_frame_ack.h" | 10 #include "cc/output/compositor_frame_ack.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 EnsureScissorTestDisabled(); | 222 EnsureScissorTestDisabled(); |
223 ClearFramebuffer(frame); | 223 ClearFramebuffer(frame); |
224 break; | 224 break; |
225 case SURFACE_INITIALIZATION_MODE_SCISSORED_CLEAR: | 225 case SURFACE_INITIALIZATION_MODE_SCISSORED_CLEAR: |
226 SetScissorTestRect(render_pass_scissor); | 226 SetScissorTestRect(render_pass_scissor); |
227 ClearFramebuffer(frame); | 227 ClearFramebuffer(frame); |
228 break; | 228 break; |
229 } | 229 } |
230 } | 230 } |
231 | 231 |
232 bool SoftwareRenderer::IsSoftwareResource( | 232 bool SoftwareRenderer::IsSoftwareResource(ResourceId resource_id) const { |
233 ResourceProvider::ResourceId resource_id) const { | |
234 switch (resource_provider_->GetResourceType(resource_id)) { | 233 switch (resource_provider_->GetResourceType(resource_id)) { |
235 case ResourceProvider::RESOURCE_TYPE_GL_TEXTURE: | 234 case ResourceProvider::RESOURCE_TYPE_GL_TEXTURE: |
236 return false; | 235 return false; |
237 case ResourceProvider::RESOURCE_TYPE_BITMAP: | 236 case ResourceProvider::RESOURCE_TYPE_BITMAP: |
238 return true; | 237 return true; |
239 } | 238 } |
240 | 239 |
241 LOG(FATAL) << "Invalid resource type."; | 240 LOG(FATAL) << "Invalid resource type."; |
242 return false; | 241 return false; |
243 } | 242 } |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 } | 650 } |
652 | 651 |
653 void SoftwareRenderer::DidChangeVisibility() { | 652 void SoftwareRenderer::DidChangeVisibility() { |
654 if (visible()) | 653 if (visible()) |
655 EnsureBackbuffer(); | 654 EnsureBackbuffer(); |
656 else | 655 else |
657 DiscardBackbuffer(); | 656 DiscardBackbuffer(); |
658 } | 657 } |
659 | 658 |
660 } // namespace cc | 659 } // namespace cc |
OLD | NEW |