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

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

Issue 2661123003: Gets views_examples drawing again (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 ~FakeReflector() override {} 45 ~FakeReflector() override {}
46 void OnMirroringCompositorResized() override {} 46 void OnMirroringCompositorResized() override {}
47 void AddMirroringLayer(Layer* layer) override {} 47 void AddMirroringLayer(Layer* layer) override {}
48 void RemoveMirroringLayer(Layer* layer) override {} 48 void RemoveMirroringLayer(Layer* layer) override {}
49 }; 49 };
50 50
51 // An OutputSurface implementation that directly draws and swaps to an actual 51 // An OutputSurface implementation that directly draws and swaps to an actual
52 // GL surface. 52 // GL surface.
53 class DirectOutputSurface : public cc::OutputSurface { 53 class DirectOutputSurface : public cc::OutputSurface {
54 public: 54 public:
55 DirectOutputSurface(scoped_refptr<InProcessContextProvider> context_provider) 55 explicit DirectOutputSurface(
56 : cc::OutputSurface(std::move(context_provider)), 56 scoped_refptr<InProcessContextProvider> context_provider)
57 weak_ptr_factory_(this) {} 57 : cc::OutputSurface(context_provider), weak_ptr_factory_(this) {
58 capabilities_.flipped_output_surface = true;
59 }
58 60
59 ~DirectOutputSurface() override {} 61 ~DirectOutputSurface() override {}
60 62
61 // cc::OutputSurface implementation. 63 // cc::OutputSurface implementation.
62 void BindToClient(cc::OutputSurfaceClient* client) override { 64 void BindToClient(cc::OutputSurfaceClient* client) override {
63 client_ = client; 65 client_ = client;
64 } 66 }
65 void EnsureBackbuffer() override {} 67 void EnsureBackbuffer() override {}
66 void DiscardBackbuffer() override {} 68 void DiscardBackbuffer() override {}
67 void BindFramebuffer() override { 69 void BindFramebuffer() override {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 // Note that we are careful not to destroy a prior |data->begin_frame_source| 216 // Note that we are careful not to destroy a prior |data->begin_frame_source|
215 // until we have reset |data->display|. 217 // until we have reset |data->display|.
216 data->begin_frame_source = std::move(begin_frame_source); 218 data->begin_frame_source = std::move(begin_frame_source);
217 219
218 auto* display = per_compositor_data_[compositor.get()]->display.get(); 220 auto* display = per_compositor_data_[compositor.get()]->display.get();
219 auto compositor_frame_sink = base::MakeUnique<cc::DirectCompositorFrameSink>( 221 auto compositor_frame_sink = base::MakeUnique<cc::DirectCompositorFrameSink>(
220 compositor->frame_sink_id(), surface_manager_, display, context_provider, 222 compositor->frame_sink_id(), surface_manager_, display, context_provider,
221 shared_worker_context_provider_, &gpu_memory_buffer_manager_, 223 shared_worker_context_provider_, &gpu_memory_buffer_manager_,
222 &shared_bitmap_manager_); 224 &shared_bitmap_manager_);
223 compositor->SetCompositorFrameSink(std::move(compositor_frame_sink)); 225 compositor->SetCompositorFrameSink(std::move(compositor_frame_sink));
226
227 data->display->Resize(compositor->size());
224 } 228 }
225 229
226 std::unique_ptr<Reflector> InProcessContextFactory::CreateReflector( 230 std::unique_ptr<Reflector> InProcessContextFactory::CreateReflector(
227 Compositor* mirrored_compositor, 231 Compositor* mirrored_compositor,
228 Layer* mirroring_layer) { 232 Layer* mirroring_layer) {
229 return base::WrapUnique(new FakeReflector); 233 return base::WrapUnique(new FakeReflector);
230 } 234 }
231 235
232 void InProcessContextFactory::RemoveReflector(Reflector* reflector) { 236 void InProcessContextFactory::RemoveReflector(Reflector* reflector) {
233 } 237 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 data->surface_handle = tracker->AddSurfaceForNativeWidget(widget); 336 data->surface_handle = tracker->AddSurfaceForNativeWidget(widget);
333 #endif 337 #endif
334 } 338 }
335 339
336 PerCompositorData* return_ptr = data.get(); 340 PerCompositorData* return_ptr = data.get();
337 per_compositor_data_[compositor] = std::move(data); 341 per_compositor_data_[compositor] = std::move(data);
338 return return_ptr; 342 return return_ptr;
339 } 343 }
340 344
341 } // namespace ui 345 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698