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

Side by Side Diff: content/browser/compositor/gpu_browser_compositor_output_surface.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
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 "content/browser/compositor/gpu_browser_compositor_output_surface.h" 5 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "cc/output/output_surface_client.h" 10 #include "cc/output/output_surface_client.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 void GpuBrowserCompositorOutputSurface::EnsureBackbuffer() {} 78 void GpuBrowserCompositorOutputSurface::EnsureBackbuffer() {}
79 79
80 void GpuBrowserCompositorOutputSurface::DiscardBackbuffer() { 80 void GpuBrowserCompositorOutputSurface::DiscardBackbuffer() {
81 context_provider()->ContextGL()->DiscardBackbufferCHROMIUM(); 81 context_provider()->ContextGL()->DiscardBackbufferCHROMIUM();
82 } 82 }
83 83
84 void GpuBrowserCompositorOutputSurface::BindFramebuffer() { 84 void GpuBrowserCompositorOutputSurface::BindFramebuffer() {
85 context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); 85 context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0);
86 } 86 }
87 87
88 void GpuBrowserCompositorOutputSurface::Reshape(
89 const gfx::Size& size,
90 float device_scale_factor,
91 const gfx::ColorSpace& color_space,
92 bool has_alpha) {
93 context_provider()->ContextGL()->ResizeCHROMIUM(
94 size.width(), size.height(), device_scale_factor, has_alpha);
95 }
96
88 void GpuBrowserCompositorOutputSurface::SwapBuffers( 97 void GpuBrowserCompositorOutputSurface::SwapBuffers(
89 cc::OutputSurfaceFrame frame) { 98 cc::OutputSurfaceFrame frame) {
90 GetCommandBufferProxy()->SetLatencyInfo(frame.latency_info); 99 GetCommandBufferProxy()->SetLatencyInfo(frame.latency_info);
91 100
92 gfx::Rect swap_rect = frame.sub_buffer_rect; 101 gfx::Rect swap_rect = frame.sub_buffer_rect;
93 gfx::Size surface_size = frame.size; 102 gfx::Size surface_size = frame.size;
94 if (reflector_) { 103 if (reflector_) {
95 if (swap_rect == gfx::Rect(surface_size)) { 104 if (swap_rect == gfx::Rect(surface_size)) {
96 reflector_texture_->CopyTextureFullImage(surface_size); 105 reflector_texture_->CopyTextureFullImage(surface_size);
97 reflector_->OnSourceSwapBuffers(surface_size); 106 reflector_->OnSourceSwapBuffers(surface_size);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); 140 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info);
132 client_->DidSwapBuffersComplete(); 141 client_->DidSwapBuffersComplete();
133 } 142 }
134 143
135 #if defined(OS_MACOSX) 144 #if defined(OS_MACOSX)
136 void GpuBrowserCompositorOutputSurface::SetSurfaceSuspendedForRecycle( 145 void GpuBrowserCompositorOutputSurface::SetSurfaceSuspendedForRecycle(
137 bool suspended) {} 146 bool suspended) {}
138 #endif 147 #endif
139 148
140 } // namespace content 149 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698