diff options
-rw-r--r-- | cc/bitmap_content_layer_updater.cc | 1 | ||||
-rw-r--r-- | cc/bitmap_skpicture_content_layer_updater.cc | 1 | ||||
-rw-r--r-- | cc/caching_bitmap_content_layer_updater.cc | 1 | ||||
-rw-r--r-- | cc/caching_bitmap_content_layer_updater.h | 1 | ||||
-rw-r--r-- | cc/content_layer.cc | 2 | ||||
-rw-r--r-- | cc/content_layer_updater.h | 1 | ||||
-rw-r--r-- | cc/image_layer.cc | 1 | ||||
-rw-r--r-- | cc/image_layer_updater.cc | 11 | ||||
-rw-r--r-- | cc/image_layer_updater.h | 8 | ||||
-rw-r--r-- | cc/layer_tree_host.cc | 1 | ||||
-rw-r--r-- | cc/layer_tree_host.h | 5 | ||||
-rw-r--r-- | cc/layer_tree_host_unittest.cc | 1 | ||||
-rw-r--r-- | cc/layer_updater.cc | 13 | ||||
-rw-r--r-- | cc/layer_updater.h | 12 | ||||
-rw-r--r-- | cc/nine_patch_layer.cc | 1 | ||||
-rw-r--r-- | cc/nine_patch_layer_unittest.cc | 7 | ||||
-rw-r--r-- | cc/resource_update_controller_unittest.cc | 1 | ||||
-rw-r--r-- | cc/scrollbar_layer.cc | 2 | ||||
-rw-r--r-- | cc/scrollbar_layer.h | 6 | ||||
-rw-r--r-- | cc/single_thread_proxy.cc | 1 | ||||
-rw-r--r-- | cc/skpicture_content_layer_updater.cc | 1 | ||||
-rw-r--r-- | cc/thread_proxy.cc | 1 | ||||
-rw-r--r-- | cc/tiled_layer.cc | 3 | ||||
-rw-r--r-- | cc/tiled_layer.h | 8 | ||||
-rw-r--r-- | cc/tiled_layer_unittest.cc | 1 |
25 files changed, 66 insertions, 25 deletions
diff --git a/cc/bitmap_content_layer_updater.cc b/cc/bitmap_content_layer_updater.cc index 5200573..222ab21 100644 --- a/cc/bitmap_content_layer_updater.cc +++ b/cc/bitmap_content_layer_updater.cc @@ -5,6 +5,7 @@ #include "cc/bitmap_content_layer_updater.h" #include "cc/layer_painter.h" +#include "cc/prioritized_resource.h" #include "cc/rendering_stats.h" #include "cc/resource_update.h" #include "cc/resource_update_queue.h" diff --git a/cc/bitmap_skpicture_content_layer_updater.cc b/cc/bitmap_skpicture_content_layer_updater.cc index 54d04fb..8434b98 100644 --- a/cc/bitmap_skpicture_content_layer_updater.cc +++ b/cc/bitmap_skpicture_content_layer_updater.cc @@ -6,6 +6,7 @@ #include "base/time.h" #include "cc/layer_painter.h" +#include "cc/prioritized_resource.h" #include "cc/rendering_stats.h" #include "cc/resource_update_queue.h" #include "third_party/skia/include/core/SkCanvas.h" diff --git a/cc/caching_bitmap_content_layer_updater.cc b/cc/caching_bitmap_content_layer_updater.cc index 937b57d..18e9768 100644 --- a/cc/caching_bitmap_content_layer_updater.cc +++ b/cc/caching_bitmap_content_layer_updater.cc @@ -4,6 +4,7 @@ #include "caching_bitmap_content_layer_updater.h" +#include "base/logging.h" #include "cc/layer_painter.h" #include "skia/ext/platform_canvas.h" diff --git a/cc/caching_bitmap_content_layer_updater.h b/cc/caching_bitmap_content_layer_updater.h index 8eab5a6..630e2f3 100644 --- a/cc/caching_bitmap_content_layer_updater.h +++ b/cc/caching_bitmap_content_layer_updater.h @@ -7,6 +7,7 @@ #include "base/compiler_specific.h" #include "cc/bitmap_content_layer_updater.h" +#include "third_party/skia/include/core/SkBitmap.h" namespace cc { diff --git a/cc/content_layer.cc b/cc/content_layer.cc index df6ae88..a0ddc89 100644 --- a/cc/content_layer.cc +++ b/cc/content_layer.cc @@ -104,7 +104,7 @@ void ContentLayer::createUpdaterIfNeeded() m_updater = BitmapContentLayerUpdater::create(painter.Pass()); m_updater->setOpaque(contentsOpaque()); - GLenum textureFormat = layerTreeHost()->rendererCapabilities().bestTextureFormat; + unsigned textureFormat = layerTreeHost()->rendererCapabilities().bestTextureFormat; setTextureFormat(textureFormat); } diff --git a/cc/content_layer_updater.h b/cc/content_layer_updater.h index 7f54be8..a51b0e9 100644 --- a/cc/content_layer_updater.h +++ b/cc/content_layer_updater.h @@ -7,6 +7,7 @@ #include "cc/cc_export.h" #include "cc/layer_updater.h" +#include "ui/gfx/rect.h" class SkCanvas; diff --git a/cc/image_layer.cc b/cc/image_layer.cc index 82ce952..5ecff78 100644 --- a/cc/image_layer.cc +++ b/cc/image_layer.cc @@ -8,6 +8,7 @@ #include "cc/image_layer_updater.h" #include "cc/layer_updater.h" #include "cc/layer_tree_host.h" +#include "cc/prioritized_resource.h" #include "cc/resource_update_queue.h" namespace cc { diff --git a/cc/image_layer_updater.cc b/cc/image_layer_updater.cc index 8f97359..9ba902e 100644 --- a/cc/image_layer_updater.cc +++ b/cc/image_layer_updater.cc @@ -3,10 +3,21 @@ // found in the LICENSE file. #include "cc/image_layer_updater.h" +#include "cc/prioritized_resource.h" #include "cc/resource_update_queue.h" namespace cc { +ImageLayerUpdater::Resource::Resource(ImageLayerUpdater* updater, scoped_ptr<PrioritizedResource> texture) + : LayerUpdater::Resource(texture.Pass()) + , m_updater(updater) +{ +} + +ImageLayerUpdater::Resource::~Resource() +{ +} + void ImageLayerUpdater::Resource::update(ResourceUpdateQueue& queue, const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats&) { m_updater->updateTexture(queue, texture(), sourceRect, destOffset, partialUpdate); diff --git a/cc/image_layer_updater.h b/cc/image_layer_updater.h index fcb2efc..938d07a 100644 --- a/cc/image_layer_updater.h +++ b/cc/image_layer_updater.h @@ -6,6 +6,7 @@ #define CC_IMAGE_LAYER_UPDATER_H_ #include "cc/layer_updater.h" +#include "third_party/skia/include/core/SkBitmap.h" namespace cc { @@ -15,11 +16,8 @@ class ImageLayerUpdater : public LayerUpdater { public: class Resource : public LayerUpdater::Resource { public: - Resource(ImageLayerUpdater* updater, scoped_ptr<PrioritizedResource> texture) - : LayerUpdater::Resource(texture.Pass()) - , m_updater(updater) - { - } + Resource(ImageLayerUpdater* updater, scoped_ptr<PrioritizedResource> texture); + virtual ~Resource(); virtual void update(ResourceUpdateQueue&, const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE; diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc index 390f001..9a42c63 100644 --- a/cc/layer_tree_host.cc +++ b/cc/layer_tree_host.cc @@ -23,6 +23,7 @@ #include "cc/math_util.h" #include "cc/occlusion_tracker.h" #include "cc/overdraw_metrics.h" +#include "cc/prioritized_resource_manager.h" #include "cc/single_thread_proxy.h" #include "cc/switches.h" #include "cc/thread.h" diff --git a/cc/layer_tree_host.h b/cc/layer_tree_host.h index 0b4f3ad..664c92a 100644 --- a/cc/layer_tree_host.h +++ b/cc/layer_tree_host.h @@ -20,7 +20,6 @@ #include "cc/layer_tree_settings.h" #include "cc/occlusion_tracker.h" #include "cc/output_surface.h" -#include "cc/prioritized_resource_manager.h" #include "cc/proxy.h" #include "cc/rate_limiter.h" #include "cc/rendering_stats.h" @@ -46,6 +45,8 @@ class Layer; class LayerTreeHostImpl; class LayerTreeHostImplClient; class PrioritizedResourceManager; +class PrioritizedResource; +class ResourceProvider; class ResourceUpdateQueue; class HeadsUpDisplayLayer; class Region; @@ -57,7 +58,7 @@ struct CC_EXPORT RendererCapabilities { RendererCapabilities(); ~RendererCapabilities(); - GLenum bestTextureFormat; + unsigned bestTextureFormat; bool usingPartialSwap; bool usingAcceleratedPainting; bool usingSetVisibility; diff --git a/cc/layer_tree_host_unittest.cc b/cc/layer_tree_host_unittest.cc index 3f879a9..de4035a 100644 --- a/cc/layer_tree_host_unittest.cc +++ b/cc/layer_tree_host_unittest.cc @@ -11,6 +11,7 @@ #include "cc/layer_tree_host_impl.h" #include "cc/layer_tree_impl.h" #include "cc/output_surface.h" +#include "cc/prioritized_resource.h" #include "cc/single_thread_proxy.h" #include "cc/test/fake_content_layer.h" #include "cc/test/fake_content_layer_client.h" diff --git a/cc/layer_updater.cc b/cc/layer_updater.cc index 2b0f775..2172952 100644 --- a/cc/layer_updater.cc +++ b/cc/layer_updater.cc @@ -4,15 +4,20 @@ #include "cc/layer_updater.h" +#include "cc/prioritized_resource.h" + namespace cc { LayerUpdater::Resource::Resource(scoped_ptr<PrioritizedResource> texture) - : m_texture(texture.Pass()) -{ + : m_texture(texture.Pass()) { +} + +void LayerUpdater::Resource::swapTextureWith( + scoped_ptr<PrioritizedResource>& texture) { + m_texture.swap(texture); } -LayerUpdater::Resource::~Resource() -{ +LayerUpdater::Resource::~Resource() { } } // namespace cc diff --git a/cc/layer_updater.h b/cc/layer_updater.h index ccab945..5ee4a2c 100644 --- a/cc/layer_updater.h +++ b/cc/layer_updater.h @@ -6,20 +6,22 @@ #define CC_LAYER_UPDATER_H_ #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "cc/cc_export.h" -#include "cc/prioritized_resource.h" -#include "third_party/khronos/GLES2/gl2.h" namespace gfx { class Rect; +class Size; class Vector2d; } namespace cc { +class PrioritizedResource; +class PrioritizedResourceManager; +class ResourceUpdateQueue; class TextureManager; struct RenderingStats; -class ResourceUpdateQueue; class CC_EXPORT LayerUpdater : public base::RefCounted<LayerUpdater> { public: @@ -29,7 +31,7 @@ public: virtual ~Resource(); PrioritizedResource* texture() { return m_texture.get(); } - void swapTextureWith(scoped_ptr<PrioritizedResource>& texture) { m_texture.swap(texture); } + void swapTextureWith(scoped_ptr<PrioritizedResource>& texture); // TODO(reveman): partialUpdate should be a property of this class // instead of an argument passed to update(). virtual void update(ResourceUpdateQueue&, const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats&) = 0; @@ -38,6 +40,8 @@ public: private: scoped_ptr<PrioritizedResource> m_texture; + + DISALLOW_COPY_AND_ASSIGN(Resource); }; LayerUpdater() { } diff --git a/cc/nine_patch_layer.cc b/cc/nine_patch_layer.cc index 657a37d..54f50f3 100644 --- a/cc/nine_patch_layer.cc +++ b/cc/nine_patch_layer.cc @@ -6,6 +6,7 @@ #include "cc/layer_tree_host.h" #include "cc/nine_patch_layer_impl.h" +#include "cc/prioritized_resource.h" #include "cc/resource_update.h" #include "cc/resource_update_queue.h" diff --git a/cc/nine_patch_layer_unittest.cc b/cc/nine_patch_layer_unittest.cc index 520f8d5..b1738dd 100644 --- a/cc/nine_patch_layer_unittest.cc +++ b/cc/nine_patch_layer_unittest.cc @@ -7,18 +7,19 @@ #include "cc/layer_tree_host.h" #include "cc/occlusion_tracker.h" #include "cc/overdraw_metrics.h" +#include "cc/prioritized_resource_manager.h" #include "cc/rendering_stats.h" #include "cc/resource_provider.h" -#include "cc/single_thread_proxy.h" #include "cc/resource_update_queue.h" -#include "cc/texture_uploader.h" +#include "cc/single_thread_proxy.h" #include "cc/test/fake_layer_tree_host_client.h" #include "cc/test/fake_output_surface.h" #include "cc/test/geometry_test_utils.h" #include "cc/test/layer_tree_test_common.h" -#include "SkBitmap.h" +#include "cc/texture_uploader.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/skia/include/core/SkBitmap.h" using ::testing::Mock; using ::testing::_; diff --git a/cc/resource_update_controller_unittest.cc b/cc/resource_update_controller_unittest.cc index 64ae4f1..2da1460a 100644 --- a/cc/resource_update_controller_unittest.cc +++ b/cc/resource_update_controller_unittest.cc @@ -4,6 +4,7 @@ #include "cc/resource_update_controller.h" +#include "cc/prioritized_resource_manager.h" #include "cc/single_thread_proxy.h" // For DebugScopedSetImplThread #include "cc/test/fake_output_surface.h" #include "cc/test/fake_proxy.h" diff --git a/cc/scrollbar_layer.cc b/cc/scrollbar_layer.cc index c6ca1b1..11d0fdd 100644 --- a/cc/scrollbar_layer.cc +++ b/cc/scrollbar_layer.cc @@ -6,8 +6,10 @@ #include "base/basictypes.h" #include "base/debug/trace_event.h" +#include "cc/caching_bitmap_content_layer_updater.h" #include "cc/layer_painter.h" #include "cc/layer_tree_host.h" +#include "cc/prioritized_resource.h" #include "cc/resource_update_queue.h" #include "cc/scrollbar_layer_impl.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" diff --git a/cc/scrollbar_layer.h b/cc/scrollbar_layer.h index 1816f51..2f3d6d2 100644 --- a/cc/scrollbar_layer.h +++ b/cc/scrollbar_layer.h @@ -6,15 +6,15 @@ #ifndef CC_SCROLLBAR_LAYER_H_ #define CC_SCROLLBAR_LAYER_H_ -#include "cc/caching_bitmap_content_layer_updater.h" #include "cc/cc_export.h" #include "cc/contents_scaling_layer.h" +#include "cc/layer_updater.h" #include "cc/scrollbar_theme_painter.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebScrollbar.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebScrollbarThemeGeometry.h" namespace cc { - +class CachingBitmapContentLayerUpdater; class ResourceUpdateQueue; class Scrollbar; class ScrollbarThemeComposite; @@ -68,7 +68,7 @@ private: scoped_ptr<WebKit::WebScrollbarThemeGeometry> m_geometry; int m_scrollLayerId; - GLenum m_textureFormat; + unsigned m_textureFormat; gfx::RectF m_dirtyRect; diff --git a/cc/single_thread_proxy.cc b/cc/single_thread_proxy.cc index 57667e3..33a3f58 100644 --- a/cc/single_thread_proxy.cc +++ b/cc/single_thread_proxy.cc @@ -8,6 +8,7 @@ #include "cc/draw_quad.h" #include "cc/layer_tree_host.h" #include "cc/output_surface.h" +#include "cc/prioritized_resource_manager.h" #include "cc/resource_update_controller.h" #include "cc/thread.h" diff --git a/cc/skpicture_content_layer_updater.cc b/cc/skpicture_content_layer_updater.cc index 869c6cd..86a08a2 100644 --- a/cc/skpicture_content_layer_updater.cc +++ b/cc/skpicture_content_layer_updater.cc @@ -6,6 +6,7 @@ #include "base/debug/trace_event.h" #include "cc/layer_painter.h" +#include "cc/prioritized_resource.h" #include "cc/resource_update_queue.h" #include "third_party/skia/include/core/SkCanvas.h" diff --git a/cc/thread_proxy.cc b/cc/thread_proxy.cc index 13339ab..68bb890 100644 --- a/cc/thread_proxy.cc +++ b/cc/thread_proxy.cc @@ -12,6 +12,7 @@ #include "cc/input_handler.h" #include "cc/layer_tree_host.h" #include "cc/output_surface.h" +#include "cc/prioritized_resource_manager.h" #include "cc/scheduler.h" #include "cc/thread.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebSharedGraphicsContext3D.h" diff --git a/cc/tiled_layer.cc b/cc/tiled_layer.cc index d93f65d..d814ada 100644 --- a/cc/tiled_layer.cc +++ b/cc/tiled_layer.cc @@ -9,7 +9,10 @@ #include "build/build_config.h" #include "cc/layer_impl.h" #include "cc/layer_tree_host.h" +#include "cc/layer_updater.h" #include "cc/overdraw_metrics.h" +#include "cc/prioritized_resource.h" +#include "cc/priority_calculator.h" #include "cc/tiled_layer_impl.h" #include "third_party/khronos/GLES2/gl2.h" #include "ui/gfx/rect_conversions.h" diff --git a/cc/tiled_layer.h b/cc/tiled_layer.h index e09780c..95fb843 100644 --- a/cc/tiled_layer.h +++ b/cc/tiled_layer.h @@ -8,9 +8,11 @@ #include "cc/cc_export.h" #include "cc/contents_scaling_layer.h" #include "cc/layer_tiling_data.h" -#include "cc/layer_updater.h" namespace cc { +class LayerUpdater; +class PrioritizedResourceManager; +class PrioritizedResource; class UpdatableTile; class CC_EXPORT TiledLayer : public ContentsScalingLayer { @@ -44,7 +46,7 @@ protected: // Exposed to subclasses for testing. void setTileSize(const gfx::Size&); - void setTextureFormat(GLenum textureFormat) { m_textureFormat = textureFormat; } + void setTextureFormat(unsigned textureFormat) { m_textureFormat = textureFormat; } void setBorderTexelOption(LayerTilingData::BorderTexelOption); size_t numPaintedTiles() { return m_tiler->tiles().size(); } @@ -90,7 +92,7 @@ private: bool isSmallAnimatedLayer() const; - GLenum m_textureFormat; + unsigned m_textureFormat; bool m_skipsDraw; bool m_failedUpdate; diff --git a/cc/tiled_layer_unittest.cc b/cc/tiled_layer_unittest.cc index dd636ef..6d39bb8 100644 --- a/cc/tiled_layer_unittest.cc +++ b/cc/tiled_layer_unittest.cc @@ -7,6 +7,7 @@ #include "cc/bitmap_content_layer_updater.h" #include "cc/layer_painter.h" #include "cc/overdraw_metrics.h" +#include "cc/prioritized_resource_manager.h" #include "cc/rendering_stats.h" #include "cc/resource_update_controller.h" #include "cc/single_thread_proxy.h" // For DebugScopedSetImplThread |