Skip to content

Commit

Permalink
Color: Plumb color profile from ui::Compositor to cc::DirectRenderer
Browse files Browse the repository at this point in the history
The color profile will originate in content::RenderWidgetHostViewMac
on Mac and aura::WindowTreeHost on Aura, and will need to be consumed
in the cc::GLRenderer in a shader and in the
content::GpuSurfacelessBrowserCompositorOutputSurface. Both of
these originating structures have a ui::Compositor.

This follows the same plumbing paths as device scale factor and surface
size.

BUG=622133
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review-Url: https://codereview.chromium.org/2102203003
Cr-Commit-Position: refs/heads/master@{#403296}
  • Loading branch information
ccameron-chromium authored and Commit bot committed Jun 30, 2016
1 parent 6a7671e commit 3d74bb9
Show file tree
Hide file tree
Showing 35 changed files with 165 additions and 177 deletions.
1 change: 1 addition & 0 deletions android_webview/browser/parent_output_surface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ void ParentOutputSurface::DidLoseOutputSurface() {

void ParentOutputSurface::Reshape(const gfx::Size& size,
float scale_factor,
const gfx::ColorSpace& color_space,
bool has_alpha) {
DCHECK_EQ(1.f, scale_factor);
surface_size_ = size;
Expand Down
1 change: 1 addition & 0 deletions android_webview/browser/parent_output_surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class ParentOutputSurface : NON_EXPORTED_BASE(public cc::OutputSurface) {
void DidLoseOutputSurface() override;
void Reshape(const gfx::Size& size,
float scale_factor,
const gfx::ColorSpace& color_space,
bool has_alpha) override;
void SwapBuffers(cc::CompositorFrame frame) override;
void ApplyExternalStencil() override;
Expand Down
4 changes: 4 additions & 0 deletions ash/sysui/stub_context_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,9 @@ cc::SurfaceManager* StubContextFactory::GetSurfaceManager() {
void StubContextFactory::ResizeDisplay(ui::Compositor* compositor,
const gfx::Size& size) {}

void StubContextFactory::SetDisplayColorSpace(
ui::Compositor* compositor,
const gfx::ColorSpace& color_space) {}

} // namespace sysui
} // namespace ash
2 changes: 2 additions & 0 deletions ash/sysui/stub_context_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class StubContextFactory : public ui::ContextFactory {
cc::SurfaceManager* GetSurfaceManager() override;
void ResizeDisplay(ui::Compositor* compositor,
const gfx::Size& size) override;
void SetDisplayColorSpace(ui::Compositor* compositor,
const gfx::ColorSpace& color_space) override;
void SetAuthoritativeVSyncInterval(ui::Compositor* compositor,
base::TimeDelta interval) override {}
void SetOutputIsSecure(ui::Compositor* compositor, bool secure) override {}
Expand Down
1 change: 1 addition & 0 deletions cc/output/delegating_renderer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const RendererCapabilitiesImpl& DelegatingRenderer::Capabilities() const {

void DelegatingRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
float device_scale_factor,
const gfx::ColorSpace& device_color_space,
const gfx::Rect& device_viewport_rect,
const gfx::Rect& device_clip_rect,
bool disable_picture_quad_image_filtering) {
Expand Down
1 change: 1 addition & 0 deletions cc/output/delegating_renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class CC_EXPORT DelegatingRenderer : public Renderer {

void DrawFrame(RenderPassList* render_passes_in_draw_order,
float device_scale_factor,
const gfx::ColorSpace& device_color_space,
const gfx::Rect& device_viewport_rect,
const gfx::Rect& device_clip_rect,
bool disable_picture_quad_image_filtering) override;
Expand Down
2 changes: 2 additions & 0 deletions cc/output/direct_renderer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ void DirectRenderer::DecideRenderPassAllocationsForFrame(

void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
float device_scale_factor,
const gfx::ColorSpace& device_color_space,
const gfx::Rect& device_viewport_rect,
const gfx::Rect& device_clip_rect,
bool disable_picture_quad_image_filtering) {
Expand Down Expand Up @@ -226,6 +227,7 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
// can leave the window at the wrong size if we never draw and the proper
// viewport size is never set.
output_surface_->Reshape(device_viewport_rect.size(), device_scale_factor,
device_color_space,
frame.root_render_pass->has_transparent_background);

BeginDrawingFrame(&frame);
Expand Down
1 change: 1 addition & 0 deletions cc/output/direct_renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class CC_EXPORT DirectRenderer : public Renderer {
bool HasAllocatedResourcesForTesting(RenderPassId id) const override;
void DrawFrame(RenderPassList* render_passes_in_draw_order,
float device_scale_factor,
const gfx::ColorSpace& device_color_space,
const gfx::Rect& device_viewport_rect,
const gfx::Rect& device_clip_rect,
bool disable_picture_quad_image_filtering) override;
Expand Down
Loading

0 comments on commit 3d74bb9

Please sign in to comment.