| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 if (context_provider()) { | 46 if (context_provider()) { |
| 47 last_swap_rect_ = last_sent_frame_->sub_buffer_rect; | 47 last_swap_rect_ = last_sent_frame_->sub_buffer_rect; |
| 48 last_swap_rect_valid_ = true; | 48 last_swap_rect_valid_ = true; |
| 49 } else { | 49 } else { |
| 50 // Unknown for direct software frames. | 50 // Unknown for direct software frames. |
| 51 last_swap_rect_ = gfx::Rect(); | 51 last_swap_rect_ = gfx::Rect(); |
| 52 last_swap_rect_valid_ = false; | 52 last_swap_rect_valid_ = false; |
| 53 } | 53 } |
| 54 | 54 |
| 55 base::ThreadTaskRunnerHandle::Get()->PostTask( | 55 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 56 FROM_HERE, base::Bind(&FakeOutputSurface::SwapBuffersCallback, | 56 FROM_HERE, base::Bind(&FakeOutputSurface::SwapBuffersAck, |
| 57 weak_ptr_factory_.GetWeakPtr())); | 57 weak_ptr_factory_.GetWeakPtr())); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void FakeOutputSurface::SwapBuffersCallback() { | 60 void FakeOutputSurface::SwapBuffersAck() { |
| 61 client_->DidSwapBuffersComplete(); | 61 client_->DidReceiveSwapBuffersAck(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void FakeOutputSurface::BindFramebuffer() { | 64 void FakeOutputSurface::BindFramebuffer() { |
| 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 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 96 | 96 |
| 97 bool FakeOutputSurface::IsDisplayedAsOverlayPlane() const { | 97 bool FakeOutputSurface::IsDisplayedAsOverlayPlane() const { |
| 98 return false; | 98 return false; |
| 99 } | 99 } |
| 100 | 100 |
| 101 unsigned FakeOutputSurface::GetOverlayTextureId() const { | 101 unsigned FakeOutputSurface::GetOverlayTextureId() const { |
| 102 return 0; | 102 return 0; |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace cc | 105 } // namespace cc |
| OLD | NEW |