| 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/test/fake_output_surface.h" | 5 #include "cc/test/fake_output_surface.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
| 9 #include "cc/output/output_surface_client.h" | 9 #include "cc/output/output_surface_client.h" |
| 10 #include "cc/resources/returned_resource.h" | 10 #include "cc/resources/returned_resource.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, framebuffer_); | 65 context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, framebuffer_); |
| 66 } | 66 } |
| 67 | 67 |
| 68 uint32_t FakeOutputSurface::GetFramebufferCopyTextureFormat() { | 68 uint32_t FakeOutputSurface::GetFramebufferCopyTextureFormat() { |
| 69 if (framebuffer_) | 69 if (framebuffer_) |
| 70 return framebuffer_format_; | 70 return framebuffer_format_; |
| 71 else | 71 else |
| 72 return GL_RGB; | 72 return GL_RGB; |
| 73 } | 73 } |
| 74 | 74 |
| 75 bool FakeOutputSurface::BindToClient(OutputSurfaceClient* client) { | 75 void FakeOutputSurface::BindToClient(OutputSurfaceClient* client) { |
| 76 if (OutputSurface::BindToClient(client)) { | 76 DCHECK(client); |
| 77 client_ = client; | 77 DCHECK(!client_); |
| 78 return true; | 78 client_ = client; |
| 79 } else { | |
| 80 return false; | |
| 81 } | |
| 82 } | 79 } |
| 83 | 80 |
| 84 bool FakeOutputSurface::HasExternalStencilTest() const { | 81 bool FakeOutputSurface::HasExternalStencilTest() const { |
| 85 return has_external_stencil_test_; | 82 return has_external_stencil_test_; |
| 86 } | 83 } |
| 87 | 84 |
| 88 bool FakeOutputSurface::SurfaceIsSuspendForRecycle() const { | 85 bool FakeOutputSurface::SurfaceIsSuspendForRecycle() const { |
| 89 return suspended_for_recycle_; | 86 return suspended_for_recycle_; |
| 90 } | 87 } |
| 91 | 88 |
| 92 OverlayCandidateValidator* FakeOutputSurface::GetOverlayCandidateValidator() | 89 OverlayCandidateValidator* FakeOutputSurface::GetOverlayCandidateValidator() |
| 93 const { | 90 const { |
| 94 return overlay_candidate_validator_; | 91 return overlay_candidate_validator_; |
| 95 } | 92 } |
| 96 | 93 |
| 97 bool FakeOutputSurface::IsDisplayedAsOverlayPlane() const { | 94 bool FakeOutputSurface::IsDisplayedAsOverlayPlane() const { |
| 98 return false; | 95 return false; |
| 99 } | 96 } |
| 100 | 97 |
| 101 unsigned FakeOutputSurface::GetOverlayTextureId() const { | 98 unsigned FakeOutputSurface::GetOverlayTextureId() const { |
| 102 return 0; | 99 return 0; |
| 103 } | 100 } |
| 104 | 101 |
| 105 } // namespace cc | 102 } // namespace cc |
| OLD | NEW |