Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: ui/compositor/test/in_process_context_factory.cc

Issue 2399983003: cc: Make OutputSurface::Reshape abstract (Closed)
Patch Set: reshapeabstract: . Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/ui/surfaces/direct_output_surface_ozone.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // GL surface. 49 // GL surface.
50 class DirectOutputSurface : public cc::OutputSurface { 50 class DirectOutputSurface : public cc::OutputSurface {
51 public: 51 public:
52 DirectOutputSurface(scoped_refptr<InProcessContextProvider> context_provider) 52 DirectOutputSurface(scoped_refptr<InProcessContextProvider> context_provider)
53 : cc::OutputSurface(std::move(context_provider)), 53 : cc::OutputSurface(std::move(context_provider)),
54 weak_ptr_factory_(this) {} 54 weak_ptr_factory_(this) {}
55 55
56 ~DirectOutputSurface() override {} 56 ~DirectOutputSurface() override {}
57 57
58 // cc::OutputSurface implementation. 58 // cc::OutputSurface implementation.
59 bool BindToClient(cc::OutputSurfaceClient* client) override {
60 return OutputSurface::BindToClient(client);
61 }
59 void EnsureBackbuffer() override {} 62 void EnsureBackbuffer() override {}
60 void DiscardBackbuffer() override {} 63 void DiscardBackbuffer() override {}
61 void BindFramebuffer() override { 64 void BindFramebuffer() override {
62 context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); 65 context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0);
63 } 66 }
64 bool BindToClient(cc::OutputSurfaceClient* client) override { 67 void Reshape(const gfx::Size& size,
65 if (!OutputSurface::BindToClient(client)) 68 float device_scale_factor,
66 return false; 69 const gfx::ColorSpace& color_space,
67 return true; 70 bool has_alpha) override {
71 context_provider()->ContextGL()->ResizeCHROMIUM(
72 size.width(), size.height(), device_scale_factor, has_alpha);
68 } 73 }
69 void SwapBuffers(cc::OutputSurfaceFrame frame) override { 74 void SwapBuffers(cc::OutputSurfaceFrame frame) override {
70 DCHECK(context_provider_.get()); 75 DCHECK(context_provider_.get());
71 if (frame.sub_buffer_rect == gfx::Rect(frame.size)) { 76 if (frame.sub_buffer_rect == gfx::Rect(frame.size)) {
72 context_provider_->ContextSupport()->Swap(); 77 context_provider_->ContextSupport()->Swap();
73 } else { 78 } else {
74 context_provider_->ContextSupport()->PartialSwapBuffers( 79 context_provider_->ContextSupport()->PartialSwapBuffers(
75 frame.sub_buffer_rect); 80 frame.sub_buffer_rect);
76 } 81 }
77 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); 82 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL();
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 280
276 void InProcessContextFactory::AddObserver(ContextFactoryObserver* observer) { 281 void InProcessContextFactory::AddObserver(ContextFactoryObserver* observer) {
277 observer_list_.AddObserver(observer); 282 observer_list_.AddObserver(observer);
278 } 283 }
279 284
280 void InProcessContextFactory::RemoveObserver(ContextFactoryObserver* observer) { 285 void InProcessContextFactory::RemoveObserver(ContextFactoryObserver* observer) {
281 observer_list_.RemoveObserver(observer); 286 observer_list_.RemoveObserver(observer);
282 } 287 }
283 288
284 } // namespace ui 289 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/surfaces/direct_output_surface_ozone.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698