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

Side by Side Diff: content/browser/aura/gpu_browser_compositor_output_surface.cc

Issue 120043005: Remove unneeded WebGraphicsContext3D refs from content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 "content/browser/aura/gpu_browser_compositor_output_surface.h" 5 #include "content/browser/aura/gpu_browser_compositor_output_surface.h"
6 6
7 #include "cc/output/compositor_frame.h" 7 #include "cc/output/compositor_frame.h"
8 #include "content/browser/aura/reflector_impl.h" 8 #include "content/browser/aura/reflector_impl.h"
9 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 9 #include "content/common/gpu/client/context_provider_command_buffer.h"
10 #include "gpu/command_buffer/client/gles2_interface.h"
10 11
11 namespace content { 12 namespace content {
12 13
13 GpuBrowserCompositorOutputSurface::GpuBrowserCompositorOutputSurface( 14 GpuBrowserCompositorOutputSurface::GpuBrowserCompositorOutputSurface(
14 const scoped_refptr<ContextProviderCommandBuffer>& context, 15 const scoped_refptr<ContextProviderCommandBuffer>& context,
15 int surface_id, 16 int surface_id,
16 IDMap<BrowserCompositorOutputSurface>* output_surface_map, 17 IDMap<BrowserCompositorOutputSurface>* output_surface_map,
17 base::MessageLoopProxy* compositor_message_loop, 18 base::MessageLoopProxy* compositor_message_loop,
18 base::WeakPtr<ui::Compositor> compositor) 19 base::WeakPtr<ui::Compositor> compositor)
19 : BrowserCompositorOutputSurface(context, 20 : BrowserCompositorOutputSurface(context,
20 surface_id, 21 surface_id,
21 output_surface_map, 22 output_surface_map,
22 compositor_message_loop, 23 compositor_message_loop,
23 compositor) {} 24 compositor) {}
24 25
25 GpuBrowserCompositorOutputSurface::~GpuBrowserCompositorOutputSurface() {} 26 GpuBrowserCompositorOutputSurface::~GpuBrowserCompositorOutputSurface() {}
26 27
27 void GpuBrowserCompositorOutputSurface::SwapBuffers( 28 void GpuBrowserCompositorOutputSurface::SwapBuffers(
28 cc::CompositorFrame* frame) { 29 cc::CompositorFrame* frame) {
29 DCHECK(frame->gl_frame_data); 30 DCHECK(frame->gl_frame_data);
30 31
31 WebGraphicsContext3DCommandBufferImpl* command_buffer_context = 32 ContextProviderCommandBuffer* provider_cb =
danakj 2014/01/06 20:59:37 |provider_command_buffer|? or even just |command_b
32 static_cast<WebGraphicsContext3DCommandBufferImpl*>( 33 static_cast<ContextProviderCommandBuffer*>(context_provider_.get());
33 context_provider_->Context3d());
34 CommandBufferProxyImpl* command_buffer_proxy = 34 CommandBufferProxyImpl* command_buffer_proxy =
35 command_buffer_context->GetCommandBufferProxy(); 35 provider_cb->GetCommandBufferProxy();
36 DCHECK(command_buffer_proxy); 36 DCHECK(command_buffer_proxy);
37 context_provider_->Context3d()->shallowFlushCHROMIUM(); 37 context_provider_->ContextGL()->ShallowFlushCHROMIUM();
38 command_buffer_proxy->SetLatencyInfo(frame->metadata.latency_info); 38 command_buffer_proxy->SetLatencyInfo(frame->metadata.latency_info);
39 39
40 if (reflector_.get()) { 40 if (reflector_.get()) {
41 if (frame->gl_frame_data->sub_buffer_rect == 41 if (frame->gl_frame_data->sub_buffer_rect ==
42 gfx::Rect(frame->gl_frame_data->size)) 42 gfx::Rect(frame->gl_frame_data->size))
43 reflector_->OnSwapBuffers(); 43 reflector_->OnSwapBuffers();
44 else 44 else
45 reflector_->OnPostSubBuffer(frame->gl_frame_data->sub_buffer_rect); 45 reflector_->OnPostSubBuffer(frame->gl_frame_data->sub_buffer_rect);
46 } 46 }
47 47
48 OutputSurface::SwapBuffers(frame); 48 OutputSurface::SwapBuffers(frame);
49 } 49 }
50 50
51 } // namespace content 51 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698