| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/compositor/test/in_process_context_factory.h" | 5 #include "ui/compositor/test/in_process_context_factory.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 client_ = client; | 63 client_ = client; |
| 64 } | 64 } |
| 65 void EnsureBackbuffer() override {} | 65 void EnsureBackbuffer() override {} |
| 66 void DiscardBackbuffer() override {} | 66 void DiscardBackbuffer() override {} |
| 67 void BindFramebuffer() override { | 67 void BindFramebuffer() override { |
| 68 context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); | 68 context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); |
| 69 } | 69 } |
| 70 void Reshape(const gfx::Size& size, | 70 void Reshape(const gfx::Size& size, |
| 71 float device_scale_factor, | 71 float device_scale_factor, |
| 72 const gfx::ColorSpace& color_space, | 72 const gfx::ColorSpace& color_space, |
| 73 bool has_alpha) override { | 73 bool has_alpha, |
| 74 bool use_stencil) override { |
| 74 context_provider()->ContextGL()->ResizeCHROMIUM( | 75 context_provider()->ContextGL()->ResizeCHROMIUM( |
| 75 size.width(), size.height(), device_scale_factor, has_alpha); | 76 size.width(), size.height(), device_scale_factor, has_alpha); |
| 76 } | 77 } |
| 77 void SwapBuffers(cc::OutputSurfaceFrame frame) override { | 78 void SwapBuffers(cc::OutputSurfaceFrame frame) override { |
| 78 DCHECK(context_provider_.get()); | 79 DCHECK(context_provider_.get()); |
| 79 if (frame.sub_buffer_rect == gfx::Rect(frame.size)) { | 80 if (frame.sub_buffer_rect == gfx::Rect(frame.size)) { |
| 80 context_provider_->ContextSupport()->Swap(); | 81 context_provider_->ContextSupport()->Swap(); |
| 81 } else { | 82 } else { |
| 82 context_provider_->ContextSupport()->PartialSwapBuffers( | 83 context_provider_->ContextSupport()->PartialSwapBuffers( |
| 83 frame.sub_buffer_rect); | 84 frame.sub_buffer_rect); |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 data->surface_handle = tracker->AddSurfaceForNativeWidget(widget); | 327 data->surface_handle = tracker->AddSurfaceForNativeWidget(widget); |
| 327 #endif | 328 #endif |
| 328 } | 329 } |
| 329 | 330 |
| 330 PerCompositorData* return_ptr = data.get(); | 331 PerCompositorData* return_ptr = data.get(); |
| 331 per_compositor_data_[compositor] = std::move(data); | 332 per_compositor_data_[compositor] = std::move(data); |
| 332 return return_ptr; | 333 return return_ptr; |
| 333 } | 334 } |
| 334 | 335 |
| 335 } // namespace ui | 336 } // namespace ui |
| OLD | NEW |