OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "content/browser/aura/gpu_browser_compositor_output_surface.h" | |
6 | |
7 #include "cc/output/compositor_frame.h" | |
8 #include "content/browser/aura/reflector_impl.h" | |
9 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | |
10 | |
11 namespace content { | |
12 | |
13 GpuBrowserCompositorOutputSurface::GpuBrowserCompositorOutputSurface( | |
14 const scoped_refptr<ContextProviderCommandBuffer>& context, | |
15 int surface_id, | |
16 IDMap<BrowserCompositorOutputSurface>* output_surface_map, | |
17 base::MessageLoopProxy* compositor_message_loop, | |
18 base::WeakPtr<ui::Compositor> compositor) | |
19 : BrowserCompositorOutputSurface(context, | |
20 surface_id, | |
21 output_surface_map, | |
22 compositor_message_loop, | |
23 compositor) { | |
24 DetachFromThread(); | |
piman
2013/11/07 00:45:12
This should be mostly orthogonal to HW vs SW, modu
dnicoara
2013/11/07 15:17:41
Done.
Ozone should work just fine with the thread
| |
25 } | |
26 | |
27 GpuBrowserCompositorOutputSurface::~GpuBrowserCompositorOutputSurface() {} | |
28 | |
29 void GpuBrowserCompositorOutputSurface::SwapBuffers( | |
30 cc::CompositorFrame* frame) { | |
31 DCHECK(frame->gl_frame_data); | |
32 | |
33 WebGraphicsContext3DCommandBufferImpl* command_buffer_context = | |
34 static_cast<WebGraphicsContext3DCommandBufferImpl*>( | |
35 context_provider_->Context3d()); | |
36 CommandBufferProxyImpl* command_buffer_proxy = | |
37 command_buffer_context->GetCommandBufferProxy(); | |
38 DCHECK(command_buffer_proxy); | |
39 context_provider_->Context3d()->shallowFlushCHROMIUM(); | |
40 command_buffer_proxy->SetLatencyInfo(frame->metadata.latency_info); | |
41 | |
42 if (reflector_.get()) { | |
43 if (frame->gl_frame_data->sub_buffer_rect == | |
44 gfx::Rect(frame->gl_frame_data->size)) | |
45 reflector_->OnSwapBuffers(); | |
46 else | |
47 reflector_->OnPostSubBuffer(frame->gl_frame_data->sub_buffer_rect); | |
48 } | |
49 | |
50 OutputSurface::SwapBuffers(frame); | |
51 } | |
52 | |
53 } // namespace content | |
OLD | NEW |