Commit 9b8fda3b authored by jamesr's avatar jamesr Committed by Commit bot

Define cc::RendererCapabilities in its own header, fix up includes

cc::RendererCapabilities was defined in cc/trees/layer_tree_host.h
which had a few subtle implications. First, cc/output/renderer.h needed
to #include layer_tree_host even though cc/output/ logically should not
depend on cc/trees/. Second, since layer_tree_host.h includes pretty
much the entire world, everything that was #including renderer.h was
implicitly pulling in many other headers that it may have used. In the
spirit of IWYU these files should either include or forward declare
types they use.

This puts RendererCapabilities in cc/output/renderer_capabilities and
fixes up includes in many other files.

R=danakj@chromium.org

Review URL: https://codereview.chromium.org/1007593002

Cr-Commit-Position: refs/heads/master@{#320767}
parent 323eb85b
......@@ -285,6 +285,8 @@ component("cc") {
"output/render_surface_filters.h",
"output/renderer.cc",
"output/renderer.h",
"output/renderer_capabilities.cc",
"output/renderer_capabilities.h",
"output/renderer_settings.cc",
"output/renderer_settings.h",
"output/shader.cc",
......
......@@ -311,6 +311,8 @@
'output/render_surface_filters.h',
'output/renderer.cc',
'output/renderer.h',
'output/renderer_capabilities.cc',
'output/renderer_capabilities.h',
'output/renderer_settings.cc',
'output/renderer_settings.h',
'output/shader.cc',
......
......@@ -9,6 +9,7 @@
#include "cc/layers/picture_layer_impl.h"
#include "cc/resources/display_list_recording_source.h"
#include "cc/resources/picture_pile.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/layer_tree_impl.h"
#include "third_party/skia/include/core/SkPictureRecorder.h"
#include "ui/gfx/geometry/rect_conversions.h"
......
......@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "cc/base/scoped_ptr_vector.h"
#include "cc/output/compositor_frame_metadata.h"
#include "cc/output/gl_renderer.h"
#include "cc/output/output_surface.h"
#include "cc/output/output_surface_client.h"
......
......@@ -8,7 +8,9 @@
#include "base/basictypes.h"
#include "cc/base/cc_export.h"
#include "cc/base/scoped_ptr_vector.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/output/renderer_capabilities.h"
#include "cc/output/renderer_settings.h"
#include "ui/gfx/geometry/rect.h"
namespace cc {
......
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cc/output/renderer_capabilities.h"
namespace cc {
RendererCapabilities::RendererCapabilities(ResourceFormat best_texture_format,
bool allow_partial_texture_updates,
int max_texture_size,
bool using_shared_memory_resources)
: best_texture_format(best_texture_format),
allow_partial_texture_updates(allow_partial_texture_updates),
max_texture_size(max_texture_size),
using_shared_memory_resources(using_shared_memory_resources) {
}
RendererCapabilities::RendererCapabilities()
: best_texture_format(RGBA_8888),
allow_partial_texture_updates(false),
max_texture_size(0),
using_shared_memory_resources(false) {
}
RendererCapabilities::~RendererCapabilities() {
}
} // namespace cc
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_OUTPUT_RENDERER_CAPABILITIES_H_
#define CC_OUTPUT_RENDERER_CAPABILITIES_H_
#include "cc/base/cc_export.h"
#include "cc/resources/resource_format.h"
namespace cc {
// Represents the set of capabilities that a particular Renderer has.
struct CC_EXPORT RendererCapabilities {
RendererCapabilities(ResourceFormat best_texture_format,
bool allow_partial_texture_updates,
int max_texture_size,
bool using_shared_memory_resources);
RendererCapabilities();
~RendererCapabilities();
// Duplicate any modification to this list to RendererCapabilitiesImpl.
ResourceFormat best_texture_format;
bool allow_partial_texture_updates;
int max_texture_size;
bool using_shared_memory_resources;
};
} // namespace cc
#endif // CC_OUTPUT_RENDERER_CAPABILITIES_H_
......@@ -15,6 +15,11 @@
#include "cc/surfaces/surface_id.h"
#include "cc/surfaces/surface_manager.h"
#include "cc/surfaces/surfaces_export.h"
#include "ui/events/latency_info.h"
namespace gpu {
class GpuMemoryBufferManager;
}
namespace gfx {
class Size;
......
......@@ -4,6 +4,7 @@
#include "cc/surfaces/surface_display_output_surface.h"
#include "base/bind.h"
#include "cc/output/compositor_frame.h"
#include "cc/output/compositor_frame_ack.h"
#include "cc/surfaces/display.h"
......
......@@ -4,6 +4,7 @@
#include "cc/test/fake_ui_resource_layer_tree_host_impl.h"
#include "cc/resources/ui_resource_bitmap.h"
#include "cc/test/fake_layer_tree_host_impl.h"
namespace cc {
......
......@@ -7,6 +7,7 @@
#include "cc/output/software_renderer.h"
#include "cc/quads/render_pass.h"
#include "cc/test/pixel_comparator.h"
#include "cc/trees/layer_tree_settings.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gl/gl_implementation.h"
......
......@@ -51,23 +51,6 @@ static base::StaticAtomicSequenceNumber s_layer_tree_host_sequence_number;
namespace cc {
RendererCapabilities::RendererCapabilities(ResourceFormat best_texture_format,
bool allow_partial_texture_updates,
int max_texture_size,
bool using_shared_memory_resources)
: best_texture_format(best_texture_format),
allow_partial_texture_updates(allow_partial_texture_updates),
max_texture_size(max_texture_size),
using_shared_memory_resources(using_shared_memory_resources) {}
RendererCapabilities::RendererCapabilities()
: best_texture_format(RGBA_8888),
allow_partial_texture_updates(false),
max_texture_size(0),
using_shared_memory_resources(false) {}
RendererCapabilities::~RendererCapabilities() {}
scoped_ptr<LayerTreeHost> LayerTreeHost::CreateThreaded(
LayerTreeHostClient* client,
SharedBitmapManager* shared_bitmap_manager,
......
......@@ -31,6 +31,7 @@
#include "cc/input/top_controls_state.h"
#include "cc/layers/layer_lists.h"
#include "cc/output/output_surface.h"
#include "cc/output/renderer_capabilities.h"
#include "cc/resources/resource_format.h"
#include "cc/resources/scoped_ui_resource.h"
#include "cc/surfaces/surface_sequence.h"
......@@ -67,24 +68,6 @@ struct RenderingStats;
struct ScrollAndScaleSet;
enum class GpuRasterizationStatus;
// Provides information on an Impl's rendering capabilities back to the
// LayerTreeHost.
struct CC_EXPORT RendererCapabilities {
RendererCapabilities(ResourceFormat best_texture_format,
bool allow_partial_texture_updates,
int max_texture_size,
bool using_shared_memory_resources);
RendererCapabilities();
~RendererCapabilities();
// Duplicate any modification to this list to RendererCapabilitiesImpl.
ResourceFormat best_texture_format;
bool allow_partial_texture_updates;
int max_texture_size;
bool using_shared_memory_resources;
};
class CC_EXPORT LayerTreeHost {
public:
// The SharedBitmapManager will be used on the compositor thread.
......
......@@ -33,8 +33,11 @@
#include "cc/resources/rasterizer.h"
#include "cc/resources/resource_provider.h"
#include "cc/resources/tile_manager.h"
#include "cc/resources/ui_resource_client.h"
#include "cc/scheduler/commit_earlyout_reason.h"
#include "cc/scheduler/draw_result.h"
#include "cc/trees/layer_tree_settings.h"
#include "cc/trees/proxy.h"
#include "skia/ext/refptr.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/geometry/rect.h"
......@@ -63,11 +66,13 @@ class RenderingStatsInstrumentation;
class ResourcePool;
class ScrollElasticityHelper;
class ScrollbarLayerImplBase;
class SwapPromise;
class SwapPromiseMonitor;
class TextureMailboxDeleter;
class TopControlsManager;
class UIResourceBitmap;
class UIResourceRequest;
struct RendererCapabilitiesImpl;
struct ScrollAndScaleSet;
enum class GpuRasterizationStatus {
ON,
......
......@@ -14,9 +14,12 @@
#include "cc/base/scoped_ptr_vector.h"
#include "cc/base/swap_promise.h"
#include "cc/base/synced_property.h"
#include "cc/input/layer_selection_bound.h"
#include "cc/layers/layer_impl.h"
#include "cc/output/begin_frame_args.h"
#include "cc/output/renderer.h"
#include "cc/resources/ui_resource_client.h"
#include "cc/trees/layer_tree_host_impl.h"
namespace base {
namespace trace_event {
......@@ -32,7 +35,6 @@ class FrameRateCounter;
class HeadsUpDisplayLayerImpl;
class LayerScrollOffsetDelegateProxy;
class LayerTreeDebugState;
class LayerTreeHostImpl;
class LayerTreeImpl;
class LayerTreeSettings;
class MemoryHistory;
......
......@@ -23,6 +23,7 @@ class BeginFrameSource;
class ContextProvider;
class LayerTreeHost;
class LayerTreeHostSingleThreadClient;
class ResourceUpdateQueue;
class CC_EXPORT SingleThreadProxy : public Proxy,
NON_EXPORTED_BASE(LayerTreeHostImplClient),
......
......@@ -30,6 +30,7 @@ class BeginFrameSource;
class ContextProvider;
class InputHandlerClient;
class LayerTreeHost;
class PrioritizedResourceManager;
class ResourceUpdateQueue;
class Scheduler;
class ScopedThreadProxy;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment