diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-28 01:45:35 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-28 01:45:35 +0000 |
commit | ca2902e903aba2f9964281dd875de7e4e72c08d8 (patch) | |
tree | fddaf41f587eb6dbe42a9ac4770ffe291edd797b | |
parent | 11ba3511e22a3ec614d89220ff347de1b3432b48 (diff) | |
download | chromium_src-ca2902e903aba2f9964281dd875de7e4e72c08d8.zip chromium_src-ca2902e903aba2f9964281dd875de7e4e72c08d8.tar.gz chromium_src-ca2902e903aba2f9964281dd875de7e4e72c08d8.tar.bz2 |
cc: Fix lint errors in cc.
This fixes lint errors for a bunch of files including
occlusion_tracker_unittest.cc and layer_tree_host_unittest_*.cc,
as well as everything remaining under cc/trees/ and cc/output/
R=enne
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/12471012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191092 0039d316-1c4b-4281-b951-d872f2087c98
38 files changed, 510 insertions, 451 deletions
diff --git a/cc/layers/nine_patch_layer_impl.cc b/cc/layers/nine_patch_layer_impl.cc index f41b550..d3c70f7 100644 --- a/cc/layers/nine_patch_layer_impl.cc +++ b/cc/layers/nine_patch_layer_impl.cc @@ -110,7 +110,10 @@ void NinePatchLayerImpl::AppendQuads(QuadSink* quad_sink, top_right.x(), bottom_left.y(), right_width, bottom_height); gfx::Rect top(top_left.right(), 0, middle_width, top_height); gfx::Rect left(0, top_left.bottom(), left_width, middle_height); - gfx::Rect right(top_right.x(), top_right.bottom(), right_width, left.height()); + gfx::Rect right(top_right.x(), + top_right.bottom(), + right_width, + left.height()); gfx::Rect bottom(top.x(), bottom_left.y(), top.width(), bottom_height); float img_width = image_bounds_.width(); diff --git a/cc/layers/render_pass_sink.h b/cc/layers/render_pass_sink.h index d307739e6..725f1dd 100644 --- a/cc/layers/render_pass_sink.h +++ b/cc/layers/render_pass_sink.h @@ -14,6 +14,9 @@ class RenderPass; class CC_EXPORT RenderPassSink { public: virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) = 0; + + protected: + virtual ~RenderPassSink() {} }; } // namespace cc diff --git a/cc/layers/video_layer_impl.cc b/cc/layers/video_layer_impl.cc index 94125d6..8228488 100644 --- a/cc/layers/video_layer_impl.cc +++ b/cc/layers/video_layer_impl.cc @@ -126,7 +126,7 @@ void VideoLayerImpl::WillDrawInternal(ResourceProvider* resource_provider) { return; } - // TODO: If we're in software compositing mode, we do the YUV -> RGB + // TODO(skaslev): If we're in software compositing mode, we do the YUV -> RGB // conversion here. That involves an extra copy of each frame to a bitmap. // Obviously, this is suboptimal and should be addressed once ubercompositor // starts shaping up. @@ -161,8 +161,8 @@ void VideoLayerImpl::AppendQuads(QuadSink* quad_sink, quad_sink->UseSharedQuadState(CreateSharedQuadState()); AppendDebugBorderQuad(quad_sink, shared_quad_state, append_quads_data); - // TODO: When we pass quads out of process, we need to double-buffer, or - // otherwise synchonize use of all textures in the quad. + // TODO(danakj): When we pass quads out of process, we need to double-buffer, + // or otherwise synchonize use of all textures in the quad. gfx::Rect quad_rect(content_bounds()); gfx::Rect opaque_rect(contents_opaque() ? quad_rect : gfx::Rect()); @@ -314,9 +314,9 @@ void VideoLayerImpl::DidDraw(ResourceProvider* resource_provider) { if (format_ == media::VideoFrame::NATIVE_TEXTURE && frame_->texture_target() == GL_TEXTURE_2D) { DCHECK(external_texture_resource_); - // TODO: the following assert will not be true when sending resources to a - // parent compositor. We will probably need to hold on to frame_ for - // longer, and have several "current frames" in the pipeline. + // TODO(danakj): the following assert will not be true when sending + // resources to a parent compositor. We will probably need to hold on to + // frame_ for longer, and have several "current frames" in the pipeline. DCHECK(!resource_provider->InUseByConsumer(external_texture_resource_)); resource_provider->DeleteResource(external_texture_resource_); external_texture_resource_ = 0; @@ -397,8 +397,8 @@ bool VideoLayerImpl::SetupFramePlanes(ResourceProvider* resource_provider) { VideoLayerImpl::FramePlane* plane = &frame_planes_[plane_index]; gfx::Size required_texture_size = VideoFrameDimension(frame_, plane_index); - // TODO: Remove the test against max_texture_size when tiled layers are - // implemented. + // TODO(danakj): Remove the test against max_texture_size when tiled layers + // are implemented. if (required_texture_size.IsEmpty() || required_texture_size.width() > max_texture_size || required_texture_size.height() > max_texture_size) diff --git a/cc/output/delegating_renderer.h b/cc/output/delegating_renderer.h index 6ce94fb3..a1bac0e 100644 --- a/cc/output/delegating_renderer.h +++ b/cc/output/delegating_renderer.h @@ -15,10 +15,10 @@ namespace cc { class OutputSurface; class ResourceProvider; -class CC_EXPORT DelegatingRenderer : - public Renderer, - public NON_EXPORTED_BASE( - WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback) { +class CC_EXPORT DelegatingRenderer + : public Renderer, + public NON_EXPORTED_BASE( + WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback) { public: static scoped_ptr<DelegatingRenderer> Create( RendererClient* client, @@ -40,7 +40,7 @@ class CC_EXPORT DelegatingRenderer : virtual bool IsContextLost() OVERRIDE; - virtual void SetVisible(bool) OVERRIDE; + virtual void SetVisible(bool visible) OVERRIDE; virtual void SendManagedMemoryStats(size_t bytes_visible, size_t bytes_visible_and_nearby, diff --git a/cc/output/delegating_renderer_unittest.cc b/cc/output/delegating_renderer_unittest.cc index 339e4cb..5357a58 100644 --- a/cc/output/delegating_renderer_unittest.cc +++ b/cc/output/delegating_renderer_unittest.cc @@ -91,7 +91,6 @@ class DelegatingRendererTestResources : public DelegatingRendererTest { LayerTreeHostImpl* host_impl, LayerTreeHostImpl::FrameData* frame, bool result) OVERRIDE { - frame->render_passes.clear(); frame->render_passes_by_id.clear(); diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc index f32c7ef..0789c29 100644 --- a/cc/output/direct_renderer.cc +++ b/cc/output/direct_renderer.cc @@ -4,6 +4,7 @@ #include "cc/output/direct_renderer.h" +#include <utility> #include <vector> #include "base/debug/trace_event.h" diff --git a/cc/output/geometry_binding.cc b/cc/output/geometry_binding.cc index 5c3db34..20bd666 100644 --- a/cc/output/geometry_binding.cc +++ b/cc/output/geometry_binding.cc @@ -37,9 +37,12 @@ GeometryBinding::GeometryBinding(WebKit::WebGraphicsContext3D* context, uint16_t data[6]; }; - COMPILE_ASSERT(sizeof(Quad) == 24 * sizeof(float), struct_is_densely_packed); - COMPILE_ASSERT(sizeof(QuadIndex) == 6 * sizeof(uint16_t), - struct_is_densely_packed); + COMPILE_ASSERT( + sizeof(Quad) == 24 * sizeof(float), // NOLINT(runtime/sizeof) + struct_is_densely_packed); + COMPILE_ASSERT( + sizeof(QuadIndex) == 6 * sizeof(uint16_t), // NOLINT(runtime/sizeof) + struct_is_densely_packed); Quad quad_list[8]; QuadIndex quad_index_list[8]; @@ -86,21 +89,28 @@ void GeometryBinding::PrepareForDraw() { GLC(context_, context_->bindBuffer(GL_ARRAY_BUFFER, quad_vertices_vbo_)); GLC(context_, context_->vertexAttribPointer( - PositionAttribLocation(), 3, GL_FLOAT, false, 6 * sizeof(float), 0)); + PositionAttribLocation(), + 3, + GL_FLOAT, + false, + 6 * sizeof(float), // NOLINT(runtime/sizeof) + 0)); GLC(context_, - context_->vertexAttribPointer(TexCoordAttribLocation(), - 2, - GL_FLOAT, - false, - 6 * sizeof(float), - 3 * sizeof(float))); + context_->vertexAttribPointer( + TexCoordAttribLocation(), + 2, + GL_FLOAT, + false, + 6 * sizeof(float), // NOLINT(runtime/sizeof) + 3 * sizeof(float))); // NOLINT(runtime/sizeof) GLC(context_, - context_->vertexAttribPointer(TriangleIndexAttribLocation(), - 1, - GL_FLOAT, - false, - 6 * sizeof(float), - 5 * sizeof(float))); + context_->vertexAttribPointer( + TriangleIndexAttribLocation(), + 1, + GL_FLOAT, + false, + 6 * sizeof(float), // NOLINT(runtime/sizeof) + 5 * sizeof(float))); // NOLINT(runtime/sizeof) GLC(context_, context_->enableVertexAttribArray(PositionAttribLocation())); GLC(context_, context_->enableVertexAttribArray(TexCoordAttribLocation())); GLC(context_, diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc index 0a57dba..4eac4cd 100644 --- a/cc/output/gl_renderer.cc +++ b/cc/output/gl_renderer.cc @@ -4,6 +4,7 @@ #include "cc/output/gl_renderer.h" +#include <algorithm> #include <set> #include <string> #include <vector> @@ -202,7 +203,7 @@ void GLRenderer::DebugGLCall(WebGraphicsContext3D* context, const char* command, const char* file, int line) { - unsigned long error = context->getError(); + unsigned error = context->getError(); if (error != GL_NO_ERROR) LOG(ERROR) << "GL command failed: File: " << file << "\n\tLine " << line << "\n\tcommand: " << command << ", error " @@ -216,8 +217,8 @@ void GLRenderer::SetVisible(bool visible) { EnforceMemoryPolicy(); - // TODO: Replace setVisibilityCHROMIUM() with an extension to explicitly - // manage front/backbuffers + // TODO(jamesr): Replace setVisibilityCHROMIUM() with an extension to + // explicitly manage front/backbuffers // crbug.com/116049 if (capabilities_.using_set_visibility) context_->setVisibilityCHROMIUM(visible); @@ -726,12 +727,13 @@ void GLRenderer::DrawRenderPassQuad(DrawingFrame* frame, GrTexture* texture = reinterpret_cast<GrTexture*>(filter_bitmap.getTexture()); Context()->bindTexture(GL_TEXTURE_2D, texture->getTextureHandle()); - } else + } else { contents_resource_lock = make_scoped_ptr( new ResourceProvider::ScopedSamplerGL(resource_provider_, contents_texture->id(), GL_TEXTURE_2D, GL_LINEAR)); + } int shader_quad_location = -1; int shader_edge_location = -1; @@ -897,8 +899,8 @@ void GLRenderer::DrawRenderPassQuad(DrawingFrame* frame, } if (shader_mask_sampler_location != -1) { - DCHECK(shader_mask_tex_coord_scale_location != 1); - DCHECK(shader_mask_tex_coord_offset_location != 1); + DCHECK_NE(shader_mask_tex_coord_scale_location, 1); + DCHECK_NE(shader_mask_tex_coord_offset_location, 1); GLC(Context(), Context()->activeTexture(GL_TEXTURE1)); GLC(Context(), Context()->uniform1i(shader_mask_sampler_location, 1)); GLC(Context(), @@ -1498,9 +1500,12 @@ void GLRenderer::FlushTextureQuadCache() { GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ZERO, GL_ONE)); } - COMPILE_ASSERT(sizeof(Float4) == 4 * sizeof(float), struct_is_densely_packed); - COMPILE_ASSERT(sizeof(Float16) == 16 * sizeof(float), - struct_is_densely_packed); + COMPILE_ASSERT( + sizeof(Float4) == 4 * sizeof(float), // NOLINT(runtime/sizeof) + struct_is_densely_packed); + COMPILE_ASSERT( + sizeof(Float16) == 16 * sizeof(float), // NOLINT(runtime/sizeof) + struct_is_densely_packed); // Upload the tranforms for both points and uvs. GLC(context_, diff --git a/cc/output/gl_renderer.h b/cc/output/gl_renderer.h index af50f58..f2e2944e 100644 --- a/cc/output/gl_renderer.h +++ b/cc/output/gl_renderer.h @@ -32,16 +32,16 @@ class GeometryBinding; class ScopedEnsureFramebufferAllocation; // Class that handles drawing of composited render layers using GL. -class CC_EXPORT GLRenderer : - public DirectRenderer, - public NON_EXPORTED_BASE( - WebKit::WebGraphicsContext3D:: - WebGraphicsSwapBuffersCompleteCallbackCHROMIUM), - public NON_EXPORTED_BASE( - WebKit::WebGraphicsContext3D:: - WebGraphicsMemoryAllocationChangedCallbackCHROMIUM), - public NON_EXPORTED_BASE( - WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback) { +class CC_EXPORT GLRenderer + : public DirectRenderer, + public NON_EXPORTED_BASE( + WebKit::WebGraphicsContext3D:: + WebGraphicsSwapBuffersCompleteCallbackCHROMIUM), + public NON_EXPORTED_BASE( + WebKit::WebGraphicsContext3D:: + WebGraphicsMemoryAllocationChangedCallbackCHROMIUM), + public NON_EXPORTED_BASE( + WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback) { public: static scoped_ptr<GLRenderer> Create(RendererClient* client, OutputSurface* output_surface, @@ -364,11 +364,11 @@ class CC_EXPORT GLRenderer : #if DEBUG_GL_CALLS && !defined(NDEBUG) #define GLC(context, x) \ - (x, GLRenderer::DebugGLCall (&* context, #x, __FILE__, __LINE__)) + (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) #else #define GLC(context, x) (x) #endif -} +} // namespace cc #endif // CC_OUTPUT_GL_RENDERER_H_ diff --git a/cc/output/gl_renderer_draw_cache.h b/cc/output/gl_renderer_draw_cache.h index 28d4e71..e99cc27 100644 --- a/cc/output/gl_renderer_draw_cache.h +++ b/cc/output/gl_renderer_draw_cache.h @@ -12,10 +12,14 @@ namespace cc { // Collects 4 floats at a time for easy upload to GL. -struct Float4 { float data[4]; }; +struct Float4 { + float data[4]; +}; // Collects 16 floats at a time for easy upload to GL. -struct Float16 { float data[16]; }; +struct Float16 { + float data[16]; +}; // A cache for storing textured quads to be drawn. Stores the minimum required // data to tell if two back to back draws only differ in their transform. Quads diff --git a/cc/output/gl_renderer_pixeltest.cc b/cc/output/gl_renderer_pixeltest.cc index 7715c85..b7cdbd8 100644 --- a/cc/output/gl_renderer_pixeltest.cc +++ b/cc/output/gl_renderer_pixeltest.cc @@ -392,7 +392,7 @@ class GLRendererPixelTestWithBackgroundFilter : public GLRendererPixelTest { false, // is_replica 0, // mask_resource_id filter_pass_content_rect_, // contents_changed_since_last_frame - gfx::RectF(), // mask_uv_rect + gfx::RectF(), // mask_uv_rect WebKit::WebFilterOperations(), // filters skia::RefPtr<SkImageFilter>(), // filter background_filters_); diff --git a/cc/output/gl_renderer_unittest.cc b/cc/output/gl_renderer_unittest.cc index 2e991c5..673e7cc 100644 --- a/cc/output/gl_renderer_unittest.cc +++ b/cc/output/gl_renderer_unittest.cc @@ -24,8 +24,6 @@ #include "third_party/skia/include/effects/SkColorMatrixFilter.h" #include "ui/gfx/transform.h" -using namespace WebKit; - using testing::_; using testing::AnyNumber; using testing::AtLeast; @@ -34,6 +32,19 @@ using testing::InSequence; using testing::Mock; using testing::Return; using testing::StrictMock; +using WebKit::WebGraphicsMemoryAllocation; +using WebKit::WebGLId; +using WebKit::WebString; +using WebKit::WGC3Dbitfield; +using WebKit::WGC3Dboolean; +using WebKit::WGC3Dchar; +using WebKit::WGC3Denum; +using WebKit::WGC3Dfloat; +using WebKit::WGC3Dint; +using WebKit::WGC3Dintptr; +using WebKit::WGC3Dsizei; +using WebKit::WGC3Dsizeiptr; +using WebKit::WGC3Duint; namespace cc { @@ -85,8 +96,8 @@ namespace { TEST_F(GLRendererShaderPixelTest, AllShadersCompile) { TestShaders(); } #endif -class FrameCountingMemoryAllocationSettingContext : - public TestWebGraphicsContext3D { +class FrameCountingMemoryAllocationSettingContext + : public TestWebGraphicsContext3D { public: FrameCountingMemoryAllocationSettingContext() : frame_(0) {} @@ -327,8 +338,9 @@ TEST_F(GLRendererTest, SuggestBackbufferYesWhenItAlreadyExistsShouldDoNothing) { // Suggest discarding framebuffer when one exists and the renderer is not // visible. // Expected: it is discarded and damage tracker is reset. -TEST_F(GLRendererTest, - SuggestBackbufferNoShouldDiscardBackbufferAndDamageRootLayerWhileNotVisible) { +TEST_F( + GLRendererTest, + SuggestBackbufferNoShouldDiscardBackbufferAndDamageRootLayerIfNotVisible) { renderer_.SetVisible(false); context()->SetMemoryAllocation(suggest_have_backbuffer_no_); EXPECT_EQ(1, mock_client_.set_full_root_layer_damage_count()); @@ -444,8 +456,7 @@ class ForbidSynchronousCallContext : public TestWebGraphicsContext3D { if (pname == GL_MAX_TEXTURE_SIZE) { // MAX_TEXTURE_SIZE is cached client side, so it's OK to query. *value = 1024; - } - else { + } else { ADD_FAILURE(); } } @@ -596,8 +607,8 @@ TEST(GLRendererTest2, InitializationWithQuicklyLostContextDoesNotAssert) { renderer.Initialize(); } -class ContextThatDoesNotSupportMemoryManagmentExtensions : - public TestWebGraphicsContext3D { +class ContextThatDoesNotSupportMemoryManagmentExtensions + : public TestWebGraphicsContext3D { public: ContextThatDoesNotSupportMemoryManagmentExtensions() {} @@ -610,8 +621,9 @@ class ContextThatDoesNotSupportMemoryManagmentExtensions : virtual WebString getString(WebKit::WGC3Denum name) { return WebString(); } }; -TEST(GLRendererTest2, - InitializationWithoutGpuMemoryManagerExtensionSupportShouldDefaultToNonZeroAllocation) { +TEST( + GLRendererTest2, + InitWithoutGpuMemManagerExtensionSupportShouldDefaultToNonZeroAllocation) { FakeRendererClient mock_client; scoped_ptr<OutputSurface> output_surface( FakeOutputSurface::Create3d(scoped_ptr<WebKit::WebGraphicsContext3D>( @@ -684,8 +696,8 @@ TEST(GLRendererTest2, TransparentBackground) { EXPECT_EQ(1, context->clear_count()); } -class VisibilityChangeIsLastCallTrackingContext : - public TestWebGraphicsContext3D { +class VisibilityChangeIsLastCallTrackingContext + : public TestWebGraphicsContext3D { public: VisibilityChangeIsLastCallTrackingContext() : last_call_was_set_visibility_(0) {} @@ -1333,8 +1345,8 @@ TEST_F(MockOutputSurfaceTestWithPartialSwap, DrawFrameAndSwap) { renderer_.SwapBuffers(); } -class MockOutputSurfaceTestWithSendCompositorFrame : - public MockOutputSurfaceTest { +class MockOutputSurfaceTestWithSendCompositorFrame + : public MockOutputSurfaceTest { public: virtual const LayerTreeSettings& Settings() const OVERRIDE { static LayerTreeSettings fake_settings; diff --git a/cc/output/output_surface.cc b/cc/output/output_surface.cc index f084788..9abb7f5 100644 --- a/cc/output/output_surface.cc +++ b/cc/output/output_surface.cc @@ -69,7 +69,7 @@ bool OutputSurface::BindToClient( return true; } -void OutputSurface::SendFrameToParentCompositor(CompositorFrame*) { +void OutputSurface::SendFrameToParentCompositor(CompositorFrame* frame) { NOTIMPLEMENTED(); } diff --git a/cc/output/output_surface.h b/cc/output/output_surface.h index bb473e2..e23aaaf 100644 --- a/cc/output/output_surface.h +++ b/cc/output/output_surface.h @@ -5,8 +5,6 @@ #ifndef CC_OUTPUT_OUTPUT_SURFACE_H_ #define CC_OUTPUT_OUTPUT_SURFACE_H_ -#define USE_CC_OUTPUT_SURFACE // TODO(danakj): Remove this. - #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "cc/base/cc_export.h" @@ -32,9 +30,9 @@ class OutputSurfaceClient; // surface (on the compositor thread) and go back to step 1. class CC_EXPORT OutputSurface { public: - OutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D> context3d); + explicit OutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D> context3d); - OutputSurface(scoped_ptr<cc::SoftwareOutputDevice> software_device); + explicit OutputSurface(scoped_ptr<cc::SoftwareOutputDevice> software_device); OutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D> context3d, scoped_ptr<cc::SoftwareOutputDevice> software_device); @@ -70,12 +68,12 @@ class CC_EXPORT OutputSurface { // thread-specific data for the output surface can be initialized, since from // this point on the output surface will only be used on the compositor // thread. - virtual bool BindToClient(OutputSurfaceClient*); + virtual bool BindToClient(OutputSurfaceClient* client); // Sends frame data to the parent compositor. This should only be called when // capabilities().has_parent_compositor. The implementation may destroy or // steal the contents of the CompositorFrame passed in. - virtual void SendFrameToParentCompositor(CompositorFrame*); + virtual void SendFrameToParentCompositor(CompositorFrame* frame); virtual void EnsureBackbuffer(); virtual void DiscardBackbuffer(); diff --git a/cc/output/render_surface_filters.cc b/cc/output/render_surface_filters.cc index 2c51fbc..d2178b8 100644 --- a/cc/output/render_surface_filters.cc +++ b/cc/output/render_surface_filters.cc @@ -4,6 +4,8 @@ #include "cc/output/render_surface_filters.h" +#include <algorithm> + #include "base/logging.h" #include "skia/ext/refptr.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperation.h" diff --git a/cc/output/render_surface_filters.h b/cc/output/render_surface_filters.h index e13c11c..494204c 100644 --- a/cc/output/render_surface_filters.h +++ b/cc/output/render_surface_filters.h @@ -35,5 +35,6 @@ class CC_EXPORT RenderSurfaceFilters { DISALLOW_IMPLICIT_CONSTRUCTORS(RenderSurfaceFilters); }; -} +} // namespace cc + #endif // CC_OUTPUT_RENDER_SURFACE_FILTERS_H_ diff --git a/cc/output/render_surface_filters_unittest.cc b/cc/output/render_surface_filters_unittest.cc index f2f02647..b99f70c 100644 --- a/cc/output/render_surface_filters_unittest.cc +++ b/cc/output/render_surface_filters_unittest.cc @@ -8,7 +8,8 @@ #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperation.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations.h" -using namespace WebKit; +using WebKit::WebFilterOperation; +using WebKit::WebFilterOperations; namespace cc { namespace { @@ -70,7 +71,7 @@ TEST(RenderSurfaceFiltersTest, TestColorMatrixFiltersCombined) { // Several filters should never combine: blur, drop-shadow. EXPECT_FALSE(IsCombined(WebFilterOperation::createBlurFilter(3.0f))); EXPECT_FALSE(IsCombined(WebFilterOperation::createDropShadowFilter( - WebPoint(2, 2), 3.0f, 0xffffffff))); + gfx::Point(2, 2), 3.0f, 0xffffffff))); // sepia and hue may or may not combine depending on the value. EXPECT_TRUE(IsCombined(WebFilterOperation::createSepiaFilter(0.0f))); diff --git a/cc/output/renderer.h b/cc/output/renderer.h index c4dcf3f..b2dd42c 100644 --- a/cc/output/renderer.h +++ b/cc/output/renderer.h @@ -85,6 +85,6 @@ class CC_EXPORT Renderer { DISALLOW_COPY_AND_ASSIGN(Renderer); }; -} +} // namespace cc #endif // CC_OUTPUT_RENDERER_H_ diff --git a/cc/output/shader.cc b/cc/output/shader.cc index e5f9f0a..f07d099 100644 --- a/cc/output/shader.cc +++ b/cc/output/shader.cc @@ -4,6 +4,8 @@ #include "cc/output/shader.h" +#include <algorithm> + #include "base/basictypes.h" #include "base/logging.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h" @@ -40,7 +42,7 @@ static void GetProgramUniformLocations(WebGraphicsContext3D* context, } } -} +} // namespace VertexShaderPosTex::VertexShaderPosTex() : matrix_location_(-1) {} @@ -64,7 +66,7 @@ void VertexShaderPosTex::Init(WebGraphicsContext3D* context, base_uniform_index); matrix_location_ = locations[0]; - DCHECK(matrix_location_ != -1); + DCHECK_NE(matrix_location_, -1); } std::string VertexShaderPosTex::GetShaderString() const { @@ -77,7 +79,7 @@ std::string VertexShaderPosTex::GetShaderString() const { gl_Position = matrix * a_position; v_texCoord = a_texCoord; } - ); + ); // NOLINT(whitespace/parens) } VertexShaderPosTexYUVStretch::VertexShaderPosTexYUVStretch() @@ -120,7 +122,7 @@ std::string VertexShaderPosTexYUVStretch::GetShaderString() const { gl_Position = matrix * a_position; v_texCoord = a_texCoord * texScale; } - ); + ); // NOLINT(whitespace/parens) } VertexShaderPos::VertexShaderPos() @@ -145,7 +147,7 @@ void VertexShaderPos::Init(WebGraphicsContext3D* context, base_uniform_index); matrix_location_ = locations[0]; - DCHECK(matrix_location_ != -1); + DCHECK_NE(matrix_location_, -1); } std::string VertexShaderPos::GetShaderString() const { @@ -155,7 +157,7 @@ std::string VertexShaderPos::GetShaderString() const { void main() { gl_Position = matrix * a_position; } - ); + ); // NOLINT(whitespace/parens) } VertexShaderPosTexTransform::VertexShaderPosTexTransform() @@ -201,12 +203,12 @@ std::string VertexShaderPosTexTransform::GetShaderString() const { varying vec2 v_texCoord; varying float v_alpha; void main() { - gl_Position = matrix[int(a_index * 0.25)] * a_position; - vec4 texTrans = texTransform[int(a_index * 0.25)]; + gl_Position = matrix[int(a_index * 0.25)] * a_position; // NOLINT + vec4 texTrans = texTransform[int(a_index * 0.25)]; // NOLINT v_texCoord = a_texCoord * texTrans.zw + texTrans.xy; - v_alpha = opacity[int(a_index)]; + v_alpha = opacity[int(a_index)]; // NOLINT } - ); + ); // NOLINT(whitespace/parens) } std::string VertexShaderPosTexTransformFlip::GetShaderString() const { @@ -220,13 +222,13 @@ std::string VertexShaderPosTexTransformFlip::GetShaderString() const { varying vec2 v_texCoord; varying float v_alpha; void main() { - gl_Position = matrix[int(a_index * 0.25)] * a_position; - vec4 texTrans = texTransform[int(a_index * 0.25)]; + gl_Position = matrix[int(a_index * 0.25)] * a_position; // NOLINT + vec4 texTrans = texTransform[int(a_index * 0.25)]; // NOLINT v_texCoord = a_texCoord * texTrans.zw + texTrans.xy; v_texCoord.y = 1.0 - v_texCoord.y; - v_alpha = opacity[int(a_index)]; + v_alpha = opacity[int(a_index)]; // NOLINT } - ); + ); // NOLINT(whitespace/parens) } std::string VertexShaderPosTexIdentity::GetShaderString() const { @@ -237,7 +239,7 @@ std::string VertexShaderPosTexIdentity::GetShaderString() const { gl_Position = a_position; v_texCoord = (a_position.xy + vec2(1.0)) * 0.5; } - ); + ); // NOLINT(whitespace/parens) } VertexShaderQuad::VertexShaderQuad() @@ -291,7 +293,7 @@ std::string VertexShaderQuad::GetShaderString() const { gl_Position = matrix * pos; v_texCoord = (pos.xy + vec2(0.5)) * texScale; } - ); + ); // NOLINT(whitespace/parens) } VertexShaderTile::VertexShaderTile() @@ -344,7 +346,7 @@ std::string VertexShaderTile::GetShaderString() const { gl_Position = matrix * pos; v_texCoord = pos.xy * vertexTexTransform.zw + vertexTexTransform.xy; } - ); + ); // NOLINT(whitespace/parens) } VertexShaderVideoTransform::VertexShaderVideoTransform() @@ -387,7 +389,7 @@ std::string VertexShaderVideoTransform::GetShaderString() const { v_texCoord = vec2(texMatrix * vec4(a_texCoord.x, 1.0 - a_texCoord.y, 0.0, 1.0)); } - ); + ); // NOLINT(whitespace/parens) } FragmentTexAlphaBinding::FragmentTexAlphaBinding() @@ -475,7 +477,7 @@ void FragmentTexOpaqueBinding::Init(WebGraphicsContext3D* context, base_uniform_index); sampler_location_ = locations[0]; - DCHECK(sampler_location_ != -1); + DCHECK_NE(sampler_location_, -1); } FragmentShaderOESImageExternal::FragmentShaderOESImageExternal() @@ -514,7 +516,7 @@ std::string FragmentShaderOESImageExternal::GetShaderString() const { vec4 texColor = texture2D(s_texture, v_texCoord); gl_FragColor = vec4(texColor.x, texColor.y, texColor.z, texColor.w); } - ); + ); // NOLINT(whitespace/parens) } std::string FragmentShaderRGBATexAlpha::GetShaderString() const { @@ -527,7 +529,7 @@ std::string FragmentShaderRGBATexAlpha::GetShaderString() const { vec4 texColor = texture2D(s_texture, v_texCoord); gl_FragColor = texColor * alpha; } - ); + ); // NOLINT(whitespace/parens) } std::string FragmentShaderRGBATexColorMatrixAlpha::GetShaderString() const { @@ -547,7 +549,7 @@ std::string FragmentShaderRGBATexColorMatrixAlpha::GetShaderString() const { texColor = clamp(texColor, 0.0, 1.0); gl_FragColor = texColor * alpha; } - ); + ); // NOLINT(whitespace/parens) } std::string FragmentShaderRGBATexVaryingAlpha::GetShaderString() const { @@ -560,7 +562,7 @@ std::string FragmentShaderRGBATexVaryingAlpha::GetShaderString() const { vec4 texColor = texture2D(s_texture, v_texCoord); gl_FragColor = texColor * v_alpha; } - ); + ); // NOLINT(whitespace/parens) } std::string FragmentShaderRGBATexRectVaryingAlpha::GetShaderString() const { @@ -574,7 +576,7 @@ std::string FragmentShaderRGBATexRectVaryingAlpha::GetShaderString() const { vec4 texColor = texture2DRect(s_texture, v_texCoord); gl_FragColor = texColor * v_alpha; } - ); + ); // NOLINT(whitespace/parens) } std::string FragmentShaderRGBATexOpaque::GetShaderString() const { @@ -586,7 +588,7 @@ std::string FragmentShaderRGBATexOpaque::GetShaderString() const { vec4 texColor = texture2D(s_texture, v_texCoord); gl_FragColor = vec4(texColor.rgb, 1.0); } - ); + ); // NOLINT(whitespace/parens) } std::string FragmentShaderRGBATex::GetShaderString() const { @@ -597,7 +599,7 @@ std::string FragmentShaderRGBATex::GetShaderString() const { void main() { gl_FragColor = texture2D(s_texture, v_texCoord); } - ); + ); // NOLINT(whitespace/parens) } std::string FragmentShaderRGBATexSwizzleAlpha::GetShaderString() const { @@ -611,7 +613,7 @@ std::string FragmentShaderRGBATexSwizzleAlpha::GetShaderString() const { gl_FragColor = vec4(texColor.z, texColor.y, texColor.x, texColor.w) * alpha; } - ); + ); // NOLINT(whitespace/parens) } std::string FragmentShaderRGBATexSwizzleOpaque::GetShaderString() const { @@ -623,7 +625,7 @@ std::string FragmentShaderRGBATexSwizzleOpaque::GetShaderString() const { vec4 texColor = texture2D(s_texture, v_texCoord); gl_FragColor = vec4(texColor.z, texColor.y, texColor.x, 1.0); } - ); + ); // NOLINT(whitespace/parens) } FragmentShaderRGBATexAlphaAA::FragmentShaderRGBATexAlphaAA() @@ -679,7 +681,7 @@ std::string FragmentShaderRGBATexAlphaAA::GetShaderString() const { gl_FragColor = texColor * alpha * min(min(a0, a2) * min(a1, a3), min(a4, a6) * min(a5, a7)); } - ); + ); // NOLINT(whitespace/parens) } FragmentTexClampAlphaAABinding::FragmentTexClampAlphaAABinding() @@ -741,7 +743,7 @@ std::string FragmentShaderRGBATexClampAlphaAA::GetShaderString() const { gl_FragColor = texColor * alpha * min(min(a0, a2) * min(a1, a3), min(a4, a6) * min(a5, a7)); } - ); + ); // NOLINT(whitespace/parens) } std::string FragmentShaderRGBATexClampSwizzleAlphaAA::GetShaderString() const { @@ -768,7 +770,7 @@ std::string FragmentShaderRGBATexClampSwizzleAlphaAA::GetShaderString() const { gl_FragColor = vec4(texColor.z, texColor.y, texColor.x, texColor.w) * alpha * min(min(a0, a2) * min(a1, a3), min(a4, a6) * min(a5, a7)); } - ); + ); // NOLINT(whitespace/parens) } FragmentShaderRGBATexAlphaMask::FragmentShaderRGBATexAlphaMask() @@ -827,7 +829,7 @@ std::string FragmentShaderRGBATexAlphaMask::GetShaderString() const { gl_FragColor = vec4(texColor.x, texColor.y, texColor.z, texColor.w) * alpha * maskColor.w; } - ); + ); // NOLINT(whitespace/parens) } FragmentShaderRGBATexAlphaMaskAA::FragmentShaderRGBATexAlphaMaskAA() @@ -900,10 +902,11 @@ std::string FragmentShaderRGBATexAlphaMaskAA::GetShaderString() const { alpha * maskColor.w * min(min(a0, a2) * min(a1, a3), min(a4, a6) * min(a5, a7)); } - ); + ); // NOLINT(whitespace/parens) } -FragmentShaderRGBATexAlphaMaskColorMatrixAA::FragmentShaderRGBATexAlphaMaskColorMatrixAA() +FragmentShaderRGBATexAlphaMaskColorMatrixAA:: + FragmentShaderRGBATexAlphaMaskColorMatrixAA() : sampler_location_(-1) , mask_sampler_location_(-1) , alpha_location_(-1) @@ -951,7 +954,8 @@ void FragmentShaderRGBATexAlphaMaskColorMatrixAA::Init( color_matrix_location_ != -1 && color_offset_location_ != -1); } -std::string FragmentShaderRGBATexAlphaMaskColorMatrixAA::GetShaderString() const { +std::string FragmentShaderRGBATexAlphaMaskColorMatrixAA::GetShaderString() + const { return SHADER( precision mediump float; varying vec2 v_texCoord; @@ -988,10 +992,11 @@ std::string FragmentShaderRGBATexAlphaMaskColorMatrixAA::GetShaderString() const alpha * maskColor.w * min(min(a0, a2) * min(a1, a3), min(a4, a6) * min(a5, a7)); } - ); + ); // NOLINT(whitespace/parens) } -FragmentShaderRGBATexAlphaColorMatrixAA::FragmentShaderRGBATexAlphaColorMatrixAA() +FragmentShaderRGBATexAlphaColorMatrixAA:: + FragmentShaderRGBATexAlphaColorMatrixAA() : sampler_location_(-1) , alpha_location_(-1) , edge_location_(-1) @@ -1057,10 +1062,11 @@ std::string FragmentShaderRGBATexAlphaColorMatrixAA::GetShaderString() const { gl_FragColor = vec4(texColor.x, texColor.y, texColor.z, texColor.w) * alpha * min(min(a0, a2) * min(a1, a3), min(a4, a6) * min(a5, a7)); } - ); + ); // NOLINT(whitespace/parens) } -FragmentShaderRGBATexAlphaMaskColorMatrix::FragmentShaderRGBATexAlphaMaskColorMatrix() +FragmentShaderRGBATexAlphaMaskColorMatrix:: + FragmentShaderRGBATexAlphaMaskColorMatrix() : sampler_location_(-1) , mask_sampler_location_(-1) , alpha_location_(-1) @@ -1126,7 +1132,7 @@ std::string FragmentShaderRGBATexAlphaMaskColorMatrix::GetShaderString() const { gl_FragColor = vec4(texColor.x, texColor.y, texColor.z, texColor.w) * alpha * maskColor.w; } - ); + ); // NOLINT(whitespace/parens) } FragmentShaderYUVVideo::FragmentShaderYUVVideo() @@ -1189,9 +1195,9 @@ std::string FragmentShaderYUVVideo::GetShaderString() const { float v_unsigned = texture2D(v_texture, v_texCoord).x; vec3 yuv = vec3(y_raw, u_unsigned, v_unsigned) + yuv_adj; vec3 rgb = yuv_matrix * yuv; - gl_FragColor = vec4(rgb, float(1)) * alpha; + gl_FragColor = vec4(rgb, float(1)) * alpha; // NOLINT } - ); + ); // NOLINT(whitespace/parens) } FragmentShaderColor::FragmentShaderColor() @@ -1216,7 +1222,7 @@ void FragmentShaderColor::Init(WebGraphicsContext3D* context, base_uniform_index); color_location_ = locations[0]; - DCHECK(color_location_ != -1); + DCHECK_NE(color_location_, -1); } std::string FragmentShaderColor::GetShaderString() const { @@ -1226,7 +1232,7 @@ std::string FragmentShaderColor::GetShaderString() const { void main() { gl_FragColor = color; } - ); + ); // NOLINT(whitespace/parens) } FragmentShaderColorAA::FragmentShaderColorAA() @@ -1275,7 +1281,7 @@ std::string FragmentShaderColorAA::GetShaderString() const { gl_FragColor = color * min(min(a0, a2) * min(a1, a3), min(a4, a6) * min(a5, a7)); } - ); + ); // NOLINT(whitespace/parens) } FragmentShaderCheckerboard::FragmentShaderCheckerboard() @@ -1332,7 +1338,7 @@ std::string FragmentShaderCheckerboard::GetShaderString() const { float picker = abs(coord.x - coord.y); gl_FragColor = mix(color1, color2, picker) * alpha; } - ); + ); // NOLINT(whitespace/parens) } } // namespace cc diff --git a/cc/output/shader.h b/cc/output/shader.h index bf98e69..228fc6d 100644 --- a/cc/output/shader.h +++ b/cc/output/shader.h @@ -195,7 +195,7 @@ class FragmentTexAlphaBinding { }; class FragmentTexColorMatrixAlphaBinding { -public: + public: FragmentTexColorMatrixAlphaBinding(); void Init(WebKit::WebGraphicsContext3D*, @@ -209,7 +209,7 @@ public: int fragment_tex_transform_location() const { return -1; } int sampler_location() const { return sampler_location_; } -private: + private: int sampler_location_; int alpha_location_; int color_matrix_location_; @@ -245,8 +245,9 @@ class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding { std::string GetShaderString() const; }; -class FragmentShaderRGBATexColorMatrixAlpha : public FragmentTexColorMatrixAlphaBinding { -public: +class FragmentShaderRGBATexColorMatrixAlpha + : public FragmentTexColorMatrixAlphaBinding { + public: std::string GetShaderString() const; }; @@ -339,15 +340,15 @@ class FragmentTexClampAlphaAABinding { DISALLOW_COPY_AND_ASSIGN(FragmentTexClampAlphaAABinding); }; -class FragmentShaderRGBATexClampAlphaAA : - public FragmentTexClampAlphaAABinding { +class FragmentShaderRGBATexClampAlphaAA + : public FragmentTexClampAlphaAABinding { public: std::string GetShaderString() const; }; // Swizzles the red and blue component of sampled texel. -class FragmentShaderRGBATexClampSwizzleAlphaAA : - public FragmentTexClampAlphaAABinding { +class FragmentShaderRGBATexClampSwizzleAlphaAA + : public FragmentTexClampAlphaAABinding { public: std::string GetShaderString() const; }; @@ -413,7 +414,7 @@ class FragmentShaderRGBATexAlphaMaskAA { }; class FragmentShaderRGBATexAlphaMaskColorMatrixAA { -public: + public: FragmentShaderRGBATexAlphaMaskColorMatrixAA(); std::string GetShaderString() const; @@ -434,7 +435,7 @@ public: int color_matrix_location() const { return color_matrix_location_; } int color_offset_location() const { return color_offset_location_; } -private: + private: int sampler_location_; int mask_sampler_location_; int alpha_location_; @@ -446,7 +447,7 @@ private: }; class FragmentShaderRGBATexAlphaColorMatrixAA { -public: + public: FragmentShaderRGBATexAlphaColorMatrixAA(); std::string GetShaderString() const; @@ -460,7 +461,7 @@ public: int color_matrix_location() const { return color_matrix_location_; } int color_offset_location() const { return color_offset_location_; } -private: + private: int sampler_location_; int alpha_location_; int edge_location_; @@ -469,7 +470,7 @@ private: }; class FragmentShaderRGBATexAlphaMaskColorMatrix { -public: + public: FragmentShaderRGBATexAlphaMaskColorMatrix(); std::string GetShaderString() const; @@ -489,7 +490,7 @@ public: int color_matrix_location() const { return color_matrix_location_; } int color_offset_location() const { return color_offset_location_; } -private: + private: int sampler_location_; int mask_sampler_location_; int alpha_location_; @@ -586,6 +587,6 @@ class FragmentShaderCheckerboard { DISALLOW_COPY_AND_ASSIGN(FragmentShaderCheckerboard); }; -} // namespace cc +} // namespace cc #endif // CC_OUTPUT_SHADER_H_ diff --git a/cc/output/software_frame_data.cc b/cc/output/software_frame_data.cc index ffecc3b..11feaa6 100644 --- a/cc/output/software_frame_data.cc +++ b/cc/output/software_frame_data.cc @@ -5,11 +5,11 @@ #include "cc/output/software_frame_data.h" namespace cc { - + SoftwareFrameData::SoftwareFrameData() : content_dib(TransportDIB::DefaultHandleValue()) { } - + SoftwareFrameData::~SoftwareFrameData() {} - + } // namespace cc diff --git a/cc/output/software_output_device.h b/cc/output/software_output_device.h index 1e55598..f9566f8 100644 --- a/cc/output/software_output_device.h +++ b/cc/output/software_output_device.h @@ -52,4 +52,4 @@ class CC_EXPORT SoftwareOutputDevice { } // namespace cc -#endif // CC_OUTPUT_SOFTWARE_OUTPUT_DEVICE_H_ +#endif // CC_OUTPUT_SOFTWARE_OUTPUT_DEVICE_H_ diff --git a/cc/output/software_renderer.h b/cc/output/software_renderer.h index 64d4378..2c4732a 100644 --- a/cc/output/software_renderer.h +++ b/cc/output/software_renderer.h @@ -99,6 +99,6 @@ class CC_EXPORT SoftwareRenderer : public DirectRenderer { DISALLOW_COPY_AND_ASSIGN(SoftwareRenderer); }; -} +} // namespace cc #endif // CC_OUTPUT_SOFTWARE_RENDERER_H_ diff --git a/cc/output/software_renderer_unittest.cc b/cc/output/software_renderer_unittest.cc index e324fe9..bdef48f 100644 --- a/cc/output/software_renderer_unittest.cc +++ b/cc/output/software_renderer_unittest.cc @@ -19,8 +19,6 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using namespace WebKit; - namespace cc { namespace { diff --git a/cc/output/texture_copier.cc b/cc/output/texture_copier.cc index 5a8a41d..a32fb65 100644 --- a/cc/output/texture_copier.cc +++ b/cc/output/texture_copier.cc @@ -58,7 +58,8 @@ void AcceleratedTextureCopier::CopyTexture(Parameters parameters) { #if defined(OS_ANDROID) // Clear destination to improve performance on tiling GPUs. - // TODO: Use EXT_discard_framebuffer or skip clearing if it isn't available. + // TODO(epenner): Use EXT_discard_framebuffer or skip clearing if it isn't + // available. GLC(context_, context_->clear(GL_COLOR_BUFFER_BIT)); #endif @@ -74,7 +75,7 @@ void AcceleratedTextureCopier::CopyTexture(Parameters parameters) { if (!blit_program_->initialized()) blit_program_->Initialize(context_, using_bind_uniforms_); - // TODO: Use EXT_framebuffer_blit if available. + // TODO(danakj): Use EXT_framebuffer_blit if available. GLC(context_, context_->useProgram(blit_program_->program())); const int kPositionAttribute = 0; diff --git a/cc/output/texture_copier.h b/cc/output/texture_copier.h index 8500310..ad037ba 100644 --- a/cc/output/texture_copier.h +++ b/cc/output/texture_copier.h @@ -64,6 +64,6 @@ class CC_EXPORT AcceleratedTextureCopier : public TextureCopier { DISALLOW_COPY_AND_ASSIGN(AcceleratedTextureCopier); }; -} +} // namespace cc #endif // CC_OUTPUT_TEXTURE_COPIER_H_ diff --git a/cc/output/texture_copier_unittest.cc b/cc/output/texture_copier_unittest.cc index 4069bbf..671821e 100644 --- a/cc/output/texture_copier_unittest.cc +++ b/cc/output/texture_copier_unittest.cc @@ -9,10 +9,13 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/khronos/GLES2/gl2.h" -using namespace WebKit; using testing::InSequence; using testing::Test; using testing::_; +using WebKit::WebGLId; +using WebKit::WGC3Denum; +using WebKit::WGC3Dint; +using WebKit::WGC3Dsizei; namespace cc { namespace { @@ -36,7 +39,8 @@ TEST(TextureCopierTest, TestDrawArraysCopy) { EXPECT_CALL(*mock_context, disable(GL_SCISSOR_TEST)); - // Here we check just some essential properties of copyTexture() to avoid mirroring the full implementation. + // Here we check just some essential properties of copyTexture() to avoid + // mirroring the full implementation. EXPECT_CALL(*mock_context, bindFramebuffer(GL_FRAMEBUFFER, _)); // Make sure linear filtering is disabled during the copy. @@ -51,7 +55,8 @@ TEST(TextureCopierTest, TestDrawArraysCopy) { EXPECT_CALL(*mock_context, drawArrays(_, _, _)); - // Linear filtering, default framebuffer and scissor test should be restored. + // Linear filtering, default framebuffer and scissor test should be + // restored. EXPECT_CALL(*mock_context, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); EXPECT_CALL(*mock_context, diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 2ba6da2..d7780fc 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc @@ -4,6 +4,8 @@ #include "cc/trees/layer_tree_host.h" +#include <algorithm> + #include "base/bind.h" #include "base/command_line.h" #include "base/debug/trace_event.h" diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc index 68ae9df..2959723 100644 --- a/cc/trees/layer_tree_host_common_unittest.cc +++ b/cc/trees/layer_tree_host_common_unittest.cc @@ -5317,7 +5317,7 @@ TEST(LayerTreeHostCommonTest, HitTestingForSimpleClippedLayer) { LayerImpl::Create(host_impl.active_tree(), 123); // this layer is positioned, and hit testing should correctly know where the // layer is located. - gfx::PointF position( 25.f, 25.f); + gfx::PointF position(25.f, 25.f); gfx::Size bounds(50, 50); SetLayerPropertiesForTesting(clipping_layer.get(), identity_matrix, diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 24b84ead..ffcb3b3 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -1463,8 +1463,8 @@ gfx::Vector2dF LayerTreeHostImpl::ScrollLayerWithViewportSpaceDelta( gfx::Transform::kSkipInitialization); bool did_invert = layer_impl->screen_space_transform().GetInverse( &inverse_screen_space_transform); - // TODO: With the advent of impl-side crolling for non-root layers, we may - // need to explicitly handle uninvertible transforms here. + // TODO(shawnsingh): With the advent of impl-side crolling for non-root + // layers, we may need to explicitly handle uninvertible transforms here. DCHECK(did_invert); gfx::PointF screen_space_point = diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index 9a19950..051e284 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h @@ -123,7 +123,7 @@ class CC_EXPORT LayerTreeHostImpl : public InputHandlerClient, struct CC_EXPORT FrameData : public RenderPassSink { FrameData(); - ~FrameData(); + virtual ~FrameData(); std::vector<gfx::Rect> occluding_screen_space_rects; std::vector<gfx::Rect> non_occluding_screen_space_rects; diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index b20f0e0..f98c9bf 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -1478,10 +1478,10 @@ TEST_F(LayerTreeHostImplTest, ScrollRootAndChangePageScaleOnMainThread) { // The page scale delta remains constant because the impl thread did not // scale. - // TODO: If possible, use gfx::Transform() or Skia equality functions. At - // the moment we avoid that because skia does exact bit-wise equality - // checking that does not consider -0 == +0. - // http://code.google.com/p/chromium/issues/detail?id=162747 + // TODO(shawnsingh): If possible, use gfx::Transform() or Skia equality + // functions. At the moment we avoid that because skia does exact bit-wise + // equality checking that does not consider -0 == +0. + // http://code.google.com/p/chromium/issues/detail?id=162747 EXPECT_EQ(1.0, host_impl_->active_tree()->root_layer()-> impl_transform().matrix().getDouble(0, 0)); diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index c131feb..7105fc2 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -4,6 +4,8 @@ #include "cc/trees/layer_tree_host.h" +#include <algorithm> + #include "base/synchronization/lock.h" #include "cc/animation/timing_function.h" #include "cc/layers/content_layer.h" @@ -443,7 +445,6 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestAbortFrameWhenInvisible); // to the impl side. class LayerTreeHostTestCommit : public LayerTreeHostTest { public: - LayerTreeHostTestCommit() {} virtual void BeginTest() OVERRIDE { @@ -509,7 +510,6 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestStartPageScaleAnimation); class LayerTreeHostTestSetVisible : public LayerTreeHostTest { public: - LayerTreeHostTestSetVisible() : num_draws_(0) {} virtual void BeginTest() OVERRIDE { diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc index c932f0e..b1e3205 100644 --- a/cc/trees/layer_tree_host_unittest_context.cc +++ b/cc/trees/layer_tree_host_unittest_context.cc @@ -227,15 +227,14 @@ class LayerTreeHostContextTest : public LayerTreeTest { scoped_refptr<FakeContextProvider> offscreen_contexts_compositor_thread_; }; -class LayerTreeHostContextTestLostContextSucceeds : - public LayerTreeHostContextTest { +class LayerTreeHostContextTestLostContextSucceeds + : public LayerTreeHostContextTest { public: LayerTreeHostContextTestLostContextSucceeds() : LayerTreeHostContextTest(), test_case_(0), num_losses_(0), - recovered_context_(true) { - } + recovered_context_(true) {} virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); @@ -277,77 +276,77 @@ class LayerTreeHostContextTestLostContextSucceeds : static const TestCase kTests[] = { // Losing the context and failing to recreate it (or losing it again // immediately) a small number of times should succeed. - { 1, // times_to_lose_during_commit - 0, // times_to_lose_during_draw - 3, // times_to_fail_reinitialize - 0, // times_to_fail_recreate - 0, // times_to_lose_on_recreate - 0, // times_to_fail_recreate_offscreen + { 1, // times_to_lose_during_commit + 0, // times_to_lose_during_draw + 3, // times_to_fail_reinitialize + 0, // times_to_fail_recreate + 0, // times_to_lose_on_recreate + 0, // times_to_fail_recreate_offscreen }, - { 0, // times_to_lose_during_commit - 1, // times_to_lose_during_draw - 3, // times_to_fail_reinitialize - 0, // times_to_fail_recreate - 0, // times_to_lose_on_recreate - 0, // times_to_fail_recreate_offscreen + { 0, // times_to_lose_during_commit + 1, // times_to_lose_during_draw + 3, // times_to_fail_reinitialize + 0, // times_to_fail_recreate + 0, // times_to_lose_on_recreate + 0, // times_to_fail_recreate_offscreen }, - { 1, // times_to_lose_during_commit - 0, // times_to_lose_during_draw - 0, // times_to_fail_reinitialize - 3, // times_to_fail_recreate - 0, // times_to_lose_on_recreate - 0, // times_to_fail_recreate_offscreen + { 1, // times_to_lose_during_commit + 0, // times_to_lose_during_draw + 0, // times_to_fail_reinitialize + 3, // times_to_fail_recreate + 0, // times_to_lose_on_recreate + 0, // times_to_fail_recreate_offscreen }, - { 0, // times_to_lose_during_commit - 1, // times_to_lose_during_draw - 0, // times_to_fail_reinitialize - 3, // times_to_fail_recreate - 0, // times_to_lose_on_recreate - 0, // times_to_fail_recreate_offscreen + { 0, // times_to_lose_during_commit + 1, // times_to_lose_during_draw + 0, // times_to_fail_reinitialize + 3, // times_to_fail_recreate + 0, // times_to_lose_on_recreate + 0, // times_to_fail_recreate_offscreen }, - { 1, // times_to_lose_during_commit - 0, // times_to_lose_during_draw - 0, // times_to_fail_reinitialize - 0, // times_to_fail_recreate - 3, // times_to_lose_on_recreate - 0, // times_to_fail_recreate_offscreen + { 1, // times_to_lose_during_commit + 0, // times_to_lose_during_draw + 0, // times_to_fail_reinitialize + 0, // times_to_fail_recreate + 3, // times_to_lose_on_recreate + 0, // times_to_fail_recreate_offscreen }, - { 0, // times_to_lose_during_commit - 1, // times_to_lose_during_draw - 0, // times_to_fail_reinitialize - 0, // times_to_fail_recreate - 3, // times_to_lose_on_recreate - 0, // times_to_fail_recreate_offscreen + { 0, // times_to_lose_during_commit + 1, // times_to_lose_during_draw + 0, // times_to_fail_reinitialize + 0, // times_to_fail_recreate + 3, // times_to_lose_on_recreate + 0, // times_to_fail_recreate_offscreen }, - { 1, // times_to_lose_during_commit - 0, // times_to_lose_during_draw - 0, // times_to_fail_reinitialize - 0, // times_to_fail_recreate - 0, // times_to_lose_on_recreate - 3, // times_to_fail_recreate_offscreen + { 1, // times_to_lose_during_commit + 0, // times_to_lose_during_draw + 0, // times_to_fail_reinitialize + 0, // times_to_fail_recreate + 0, // times_to_lose_on_recreate + 3, // times_to_fail_recreate_offscreen }, - { 0, // times_to_lose_during_commit - 1, // times_to_lose_during_draw - 0, // times_to_fail_reinitialize - 0, // times_to_fail_recreate - 0, // times_to_lose_on_recreate - 3, // times_to_fail_recreate_offscreen + { 0, // times_to_lose_during_commit + 1, // times_to_lose_during_draw + 0, // times_to_fail_reinitialize + 0, // times_to_fail_recreate + 0, // times_to_lose_on_recreate + 3, // times_to_fail_recreate_offscreen }, // Losing the context and recreating it any number of times should // succeed. - { 10, // times_to_lose_during_commit - 0, // times_to_lose_during_draw - 0, // times_to_fail_reinitialize - 0, // times_to_fail_recreate - 0, // times_to_lose_on_recreate - 0, // times_to_fail_recreate_offscreen + { 10, // times_to_lose_during_commit + 0, // times_to_lose_during_draw + 0, // times_to_fail_reinitialize + 0, // times_to_fail_recreate + 0, // times_to_lose_on_recreate + 0, // times_to_fail_recreate_offscreen }, - { 0, // times_to_lose_during_commit - 10, // times_to_lose_during_draw - 0, // times_to_fail_reinitialize - 0, // times_to_fail_recreate - 0, // times_to_lose_on_recreate - 0, // times_to_fail_recreate_offscreen + { 0, // times_to_lose_during_commit + 10, // times_to_lose_during_draw + 0, // times_to_fail_reinitialize + 0, // times_to_fail_recreate + 0, // times_to_lose_on_recreate + 0, // times_to_fail_recreate_offscreen }, }; @@ -384,13 +383,11 @@ class LayerTreeHostContextTestLostContextSucceeds : SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestLostContextSucceeds); -class LayerTreeHostContextTestLostContextSucceedsWithContent : - public LayerTreeHostContextTestLostContextSucceeds { +class LayerTreeHostContextTestLostContextSucceedsWithContent + : public LayerTreeHostContextTestLostContextSucceeds { public: - LayerTreeHostContextTestLostContextSucceedsWithContent() - : LayerTreeHostContextTestLostContextSucceeds() { - } + : LayerTreeHostContextTestLostContextSucceeds() {} virtual void SetupTree() OVERRIDE { root_ = Layer::Create(); @@ -438,7 +435,7 @@ class LayerTreeHostContextTestLostContextSucceedsWithContent : if (use_surface_) { EXPECT_TRUE(contexts->Context3d()); // TODO(danakj): Make a fake GrContext. - //EXPECT_TRUE(contexts->GrContext()); + // EXPECT_TRUE(contexts->GrContext()); } else { EXPECT_FALSE(contexts); } @@ -538,8 +535,8 @@ class LayerTreeHostContextTestOffscreenContextFails SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestOffscreenContextFails); -class LayerTreeHostContextTestLostContextFails : - public LayerTreeHostContextTest { +class LayerTreeHostContextTestLostContextFails + : public LayerTreeHostContextTest { public: LayerTreeHostContextTestLostContextFails() : LayerTreeHostContextTest(), @@ -628,8 +625,8 @@ TEST_F(LayerTreeHostContextTestLostContextFails, RunTest(true); } -class LayerTreeHostContextTestFinishAllRenderingAfterLoss : - public LayerTreeHostContextTest { +class LayerTreeHostContextTestFinishAllRenderingAfterLoss + : public LayerTreeHostContextTest { public: virtual void BeginTest() OVERRIDE { // Lose the context until the compositor gives up on it. @@ -650,15 +647,14 @@ class LayerTreeHostContextTestFinishAllRenderingAfterLoss : SINGLE_AND_MULTI_THREAD_TEST_F( LayerTreeHostContextTestFinishAllRenderingAfterLoss); -class LayerTreeHostContextTestLostContextAndEvictTextures : - public LayerTreeHostContextTest { +class LayerTreeHostContextTestLostContextAndEvictTextures + : public LayerTreeHostContextTest { public: LayerTreeHostContextTestLostContextAndEvictTextures() : LayerTreeHostContextTest(), layer_(FakeContentLayer::Create(&client_)), impl_host_(0), - num_commits_(0) { - } + num_commits_(0) {} virtual void SetupTree() OVERRIDE { layer_->SetBounds(gfx::Size(10, 20)); @@ -745,14 +741,13 @@ TEST_F(LayerTreeHostContextTestLostContextAndEvictTextures, RunTest(true); } -class LayerTreeHostContextTestLostContextWhileUpdatingResources : - public LayerTreeHostContextTest { +class LayerTreeHostContextTestLostContextWhileUpdatingResources + : public LayerTreeHostContextTest { public: LayerTreeHostContextTestLostContextWhileUpdatingResources() : parent_(FakeContentLayer::Create(&client_)), num_children_(50), - times_to_lose_on_end_query_(3) { - } + times_to_lose_on_end_query_(3) {} virtual scoped_ptr<TestWebGraphicsContext3D> CreateContext3d() OVERRIDE { scoped_ptr<TestWebGraphicsContext3D> context = @@ -806,13 +801,12 @@ class LayerTreeHostContextTestLostContextWhileUpdatingResources : SINGLE_AND_MULTI_THREAD_TEST_F( LayerTreeHostContextTestLostContextWhileUpdatingResources); -class LayerTreeHostContextTestLayersNotified : - public LayerTreeHostContextTest { +class LayerTreeHostContextTestLayersNotified + : public LayerTreeHostContextTest { public: LayerTreeHostContextTestLayersNotified() : LayerTreeHostContextTest(), - num_commits_(0) { - } + num_commits_(0) {} virtual void SetupTree() OVERRIDE { root_ = FakeContentLayer::Create(&client_); @@ -890,8 +884,8 @@ class LayerTreeHostContextTestLayersNotified : SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestLayersNotified); -class LayerTreeHostContextTestDontUseLostResources : - public LayerTreeHostContextTest { +class LayerTreeHostContextTestDontUseLostResources + : public LayerTreeHostContextTest { public: virtual void SetupTree() OVERRIDE { context3d_->set_have_extension_io_surface(true); @@ -1106,12 +1100,11 @@ class LayerTreeHostContextTestDontUseLostResources : SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources); -class LayerTreeHostContextTestFailsImmediately : - public LayerTreeHostContextTest { +class LayerTreeHostContextTestFailsImmediately + : public LayerTreeHostContextTest { public: LayerTreeHostContextTestFailsImmediately() - : LayerTreeHostContextTest() { - } + : LayerTreeHostContextTest() {} virtual ~LayerTreeHostContextTestFailsImmediately() {} @@ -1119,8 +1112,7 @@ class LayerTreeHostContextTestFailsImmediately : PostSetNeedsCommitToMainThread(); } - virtual void AfterTest() OVERRIDE { - } + virtual void AfterTest() OVERRIDE {} virtual scoped_ptr<TestWebGraphicsContext3D> CreateContext3d() OVERRIDE { scoped_ptr<TestWebGraphicsContext3D> context = @@ -1147,8 +1139,8 @@ class ImplSidePaintingLayerTreeHostContextTest } }; -class LayerTreeHostContextTestImplSidePainting : - public ImplSidePaintingLayerTreeHostContextTest { +class LayerTreeHostContextTestImplSidePainting + : public ImplSidePaintingLayerTreeHostContextTest { public: virtual void SetupTree() OVERRIDE { scoped_refptr<Layer> root = Layer::Create(); @@ -1198,8 +1190,7 @@ class ScrollbarLayerLostContext : public LayerTreeHostContextTest { PostSetNeedsCommitToMainThread(); } - virtual void AfterTest() OVERRIDE { - } + virtual void AfterTest() OVERRIDE {} virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { LayerTreeHostContextTest::CommitCompleteOnThread(impl); @@ -1207,7 +1198,7 @@ class ScrollbarLayerLostContext : public LayerTreeHostContextTest { ++commits_; size_t upload_count = scrollbar_layer_->last_update_full_upload_size() + scrollbar_layer_->last_update_partial_upload_size(); - switch(commits_) { + switch (commits_) { case 1: // First (regular) update, we should upload 2 resources (thumb, and // backtrack). diff --git a/cc/trees/layer_tree_host_unittest_occlusion.cc b/cc/trees/layer_tree_host_unittest_occlusion.cc index 4656ef9..221a9a9 100644 --- a/cc/trees/layer_tree_host_unittest_occlusion.cc +++ b/cc/trees/layer_tree_host_unittest_occlusion.cc @@ -49,7 +49,6 @@ class TestLayer : public Layer { class LayerTreeHostOcclusionTest : public LayerTreeTest { public: - LayerTreeHostOcclusionTest() : root_(TestLayer::Create()), child_(TestLayer::Create()), @@ -106,8 +105,8 @@ class LayerTreeHostOcclusionTest : public LayerTreeTest { }; -class LayerTreeHostOcclusionTestOcclusionSurfaceClipping : - public LayerTreeHostOcclusionTest { +class LayerTreeHostOcclusionTestOcclusionSurfaceClipping + : public LayerTreeHostOcclusionTest { public: virtual void SetupTree() OVERRIDE { // The child layer is a surface and the grand_child is opaque, but clipped @@ -124,7 +123,7 @@ class LayerTreeHostOcclusionTestOcclusionSurfaceClipping : child_->SetMasksToBounds(true); child_->SetForceRenderSurface(true); - + child_->set_expected_occlusion(gfx::Rect(0, 0, 10, 190)); root_->set_expected_occlusion(gfx::Rect(10, 10, 10, 190)); @@ -136,8 +135,8 @@ class LayerTreeHostOcclusionTestOcclusionSurfaceClipping : SINGLE_AND_MULTI_THREAD_TEST_F( LayerTreeHostOcclusionTestOcclusionSurfaceClipping); -class LayerTreeHostOcclusionTestOcclusionSurfaceClippingOpaque : - public LayerTreeHostOcclusionTest { +class LayerTreeHostOcclusionTestOcclusionSurfaceClippingOpaque + : public LayerTreeHostOcclusionTest { public: virtual void SetupTree() OVERRIDE { // If the child layer is opaque, then it adds to the occlusion seen by the @@ -166,8 +165,8 @@ class LayerTreeHostOcclusionTestOcclusionSurfaceClippingOpaque : SINGLE_AND_MULTI_THREAD_TEST_F( LayerTreeHostOcclusionTestOcclusionSurfaceClippingOpaque); -class LayerTreeHostOcclusionTestOcclusionTwoChildren : - public LayerTreeHostOcclusionTest { +class LayerTreeHostOcclusionTestOcclusionTwoChildren + : public LayerTreeHostOcclusionTest { public: virtual void SetupTree() OVERRIDE { // Add a second child to the root layer and the regions should merge @@ -199,8 +198,8 @@ class LayerTreeHostOcclusionTestOcclusionTwoChildren : SINGLE_AND_MULTI_THREAD_TEST_F( LayerTreeHostOcclusionTestOcclusionTwoChildren); -class LayerTreeHostOcclusionTestOcclusionMask : - public LayerTreeHostOcclusionTest { +class LayerTreeHostOcclusionTestOcclusionMask + : public LayerTreeHostOcclusionTest { public: virtual void SetupTree() OVERRIDE { // If the child layer has a mask on it, then it shouldn't contribute to @@ -232,8 +231,8 @@ class LayerTreeHostOcclusionTestOcclusionMask : SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostOcclusionTestOcclusionMask); -class LayerTreeHostOcclusionTestOcclusionMaskBelowOcclusion : - public LayerTreeHostOcclusionTest { +class LayerTreeHostOcclusionTestOcclusionMaskBelowOcclusion + : public LayerTreeHostOcclusionTest { public: virtual void SetupTree() OVERRIDE { // If the child layer with a mask is below child2, then child2 should @@ -255,7 +254,7 @@ class LayerTreeHostOcclusionTestOcclusionMaskBelowOcclusion : child_->SetMasksToBounds(true); child_->SetForceRenderSurface(true); child_->SetMaskLayer(mask_.get()); - + grand_child_->set_expected_occlusion(gfx::Rect(10, 0, 10, 190)); child_->set_expected_occlusion(gfx::Rect(0, 0, 20, 190)); root_->set_expected_occlusion(gfx::Rect(20, 10, 10, 190)); @@ -268,8 +267,8 @@ class LayerTreeHostOcclusionTestOcclusionMaskBelowOcclusion : SINGLE_AND_MULTI_THREAD_TEST_F( LayerTreeHostOcclusionTestOcclusionMaskBelowOcclusion); -class LayerTreeHostOcclusionTestOcclusionOpacity : - public LayerTreeHostOcclusionTest { +class LayerTreeHostOcclusionTestOcclusionOpacity + : public LayerTreeHostOcclusionTest { public: virtual void SetupTree() OVERRIDE { // If the child layer has a non-opaque opacity, then it shouldn't @@ -301,8 +300,8 @@ class LayerTreeHostOcclusionTestOcclusionOpacity : SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostOcclusionTestOcclusionOpacity); -class LayerTreeHostOcclusionTestOcclusionOpacityBelowOcclusion : - public LayerTreeHostOcclusionTest { +class LayerTreeHostOcclusionTestOcclusionOpacityBelowOcclusion + : public LayerTreeHostOcclusionTest { public: virtual void SetupTree() OVERRIDE { // If the child layer with non-opaque opacity is below child2, then @@ -337,8 +336,8 @@ class LayerTreeHostOcclusionTestOcclusionOpacityBelowOcclusion : SINGLE_AND_MULTI_THREAD_TEST_F( LayerTreeHostOcclusionTestOcclusionOpacityBelowOcclusion); -class LayerTreeHostOcclusionTestOcclusionOpacityFilter : - public LayerTreeHostOcclusionTest { +class LayerTreeHostOcclusionTestOcclusionOpacityFilter + : public LayerTreeHostOcclusionTest { public: virtual void SetupTree() OVERRIDE { gfx::Transform child_transform; @@ -381,8 +380,8 @@ class LayerTreeHostOcclusionTestOcclusionOpacityFilter : SINGLE_AND_MULTI_THREAD_TEST_F( LayerTreeHostOcclusionTestOcclusionOpacityFilter); -class LayerTreeHostOcclusionTestOcclusionBlurFilter : - public LayerTreeHostOcclusionTest { +class LayerTreeHostOcclusionTestOcclusionBlurFilter + : public LayerTreeHostOcclusionTest { public: virtual void SetupTree() OVERRIDE { gfx::Transform child_transform; @@ -423,8 +422,8 @@ class LayerTreeHostOcclusionTestOcclusionBlurFilter : SINGLE_AND_MULTI_THREAD_TEST_F( LayerTreeHostOcclusionTestOcclusionBlurFilter); -class LayerTreeHostOcclusionTestManySurfaces : - public LayerTreeHostOcclusionTest { +class LayerTreeHostOcclusionTestManySurfaces + : public LayerTreeHostOcclusionTest { public: virtual void SetupTree() OVERRIDE { // We create enough RenderSurfaces that it will trigger Vector reallocation diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc index 10f5ad6..004af24 100644 --- a/cc/trees/layer_tree_impl.cc +++ b/cc/trees/layer_tree_impl.cc @@ -191,7 +191,8 @@ void LayerTreeImpl::SetPageScaleDelta(float delta) { LayerTreeImpl* pending_tree = layer_tree_host_impl_->pending_tree(); if (pending_tree) { DCHECK_EQ(1, pending_tree->sent_page_scale_delta()); - pending_tree->SetPageScaleDelta(page_scale_delta_ / sent_page_scale_delta_); + pending_tree->SetPageScaleDelta( + page_scale_delta_ / sent_page_scale_delta_); } } @@ -257,7 +258,9 @@ struct UpdateTilePrioritiesForLayer { }; void LayerTreeImpl::UpdateDrawProperties(UpdateDrawPropertiesReason reason) { - if (settings().solid_color_scrollbars && IsActiveTree() && RootScrollLayer()) { + if (settings().solid_color_scrollbars && + IsActiveTree() && + RootScrollLayer()) { UpdateSolidColorScrollbars(); // The top controls manager is incompatible with the WebKit-created cliprect @@ -620,7 +623,8 @@ static void StartFadeInAnimation(ScrollbarLayerImpl* layer) { DCHECK(layer); float start_opacity = layer->opacity(); LayerAnimationController* controller = layer->layer_animation_controller(); - // TODO() It shouldn't be necessary to manually remove the old animation. + // TODO(wjmaclean) It shouldn't be necessary to manually remove the old + // animation. if (Animation* animation = controller->GetAnimation(Animation::Opacity)) controller->RemoveAnimation(animation->id()); controller->AddAnimation(MakePinchZoomFadeAnimation(start_opacity, @@ -661,5 +665,4 @@ bool LayerTreeImpl::HasPinchZoomScrollbars() const { pinch_zoom_scrollbar_vertical_layer_id_ != Layer::INVALID_ID; } - -} // namespace cc +} // namespace cc diff --git a/cc/trees/occlusion_tracker.cc b/cc/trees/occlusion_tracker.cc index 98ad442..1efb6c9 100644 --- a/cc/trees/occlusion_tracker.cc +++ b/cc/trees/occlusion_tracker.cc @@ -656,7 +656,8 @@ gfx::Rect OcclusionTrackerBase<LayerType, RenderSurfaceType>:: return content_rect; gfx::Transform draw_transform = - for_replica ? surface->replica_draw_transform() : surface->draw_transform(); + for_replica ? surface->replica_draw_transform() + : surface->draw_transform(); gfx::Transform inverse_draw_transform(gfx::Transform::kSkipInitialization); if (!draw_transform.GetInverse(&inverse_draw_transform)) return content_rect; diff --git a/cc/trees/occlusion_tracker_unittest.cc b/cc/trees/occlusion_tracker_unittest.cc index ad0e74a..8d6477b 100644 --- a/cc/trees/occlusion_tracker_unittest.cc +++ b/cc/trees/occlusion_tracker_unittest.cc @@ -77,15 +77,15 @@ static inline bool LayerImplDrawTransformIsUnknown(const LayerImpl* layer) { } template <typename LayerType, typename RenderSurfaceType> -class TestOcclusionTrackerWithClip : - public TestOcclusionTrackerBase<LayerType, RenderSurfaceType> { +class TestOcclusionTrackerWithClip + : public TestOcclusionTrackerBase<LayerType, RenderSurfaceType> { public: TestOcclusionTrackerWithClip(gfx::Rect viewport_rect, bool record_metrics_for_frame) : TestOcclusionTrackerBase<LayerType, RenderSurfaceType>( viewport_rect, record_metrics_for_frame) {} - TestOcclusionTrackerWithClip(gfx::Rect viewport_rect) + explicit TestOcclusionTrackerWithClip(gfx::Rect viewport_rect) : TestOcclusionTrackerBase<LayerType, RenderSurfaceType>(viewport_rect, false) {} @@ -197,7 +197,7 @@ int OcclusionTrackerTestImplThreadTypes::next_layer_impl_id = 1; template <typename Types> class OcclusionTrackerTest : public testing::Test { protected: - OcclusionTrackerTest(bool opaque_layers) + explicit OcclusionTrackerTest(bool opaque_layers) : host_impl_(&proxy_), opaque_layers_(opaque_layers) {} virtual void RunMyTest() = 0; @@ -471,34 +471,34 @@ OcclusionTrackerTest<OcclusionTrackerTestImplThreadTypes>::GetHost() { } #define RUN_TEST_MAIN_THREAD_OPAQUE_LAYERS(ClassName) \ - class ClassName##MainThreadOpaqueLayers : \ - public ClassName<OcclusionTrackerTestMainThreadTypes> { \ - public: \ + class ClassName##MainThreadOpaqueLayers \ + : public ClassName<OcclusionTrackerTestMainThreadTypes> { \ + public: /* NOLINT(whitespace/indent) */ \ ClassName##MainThreadOpaqueLayers() \ : ClassName<OcclusionTrackerTestMainThreadTypes>(true) {} \ }; \ TEST_F(ClassName##MainThreadOpaqueLayers, RunTest) { RunMyTest(); } #define RUN_TEST_MAIN_THREAD_OPAQUE_PAINTS(ClassName) \ - class ClassName##MainThreadOpaquePaints : \ - public ClassName<OcclusionTrackerTestMainThreadTypes> { \ - public: \ + class ClassName##MainThreadOpaquePaints \ + : public ClassName<OcclusionTrackerTestMainThreadTypes> { \ + public: /* NOLINT(whitespace/indent) */ \ ClassName##MainThreadOpaquePaints() \ : ClassName<OcclusionTrackerTestMainThreadTypes>(false) {} \ }; \ TEST_F(ClassName##MainThreadOpaquePaints, RunTest) { RunMyTest(); } #define RUN_TEST_IMPL_THREAD_OPAQUE_LAYERS(ClassName) \ - class ClassName##ImplThreadOpaqueLayers : \ - public ClassName<OcclusionTrackerTestImplThreadTypes> { \ - public: \ + class ClassName##ImplThreadOpaqueLayers \ + : public ClassName<OcclusionTrackerTestImplThreadTypes> { \ + public: /* NOLINT(whitespace/indent) */ \ ClassName##ImplThreadOpaqueLayers() \ : ClassName<OcclusionTrackerTestImplThreadTypes>(true) {} \ }; \ TEST_F(ClassName##ImplThreadOpaqueLayers, RunTest) { RunMyTest(); } #define RUN_TEST_IMPL_THREAD_OPAQUE_PAINTS(ClassName) \ - class ClassName##ImplThreadOpaquePaints : \ - public ClassName<OcclusionTrackerTestImplThreadTypes> { \ - public: \ + class ClassName##ImplThreadOpaquePaints \ + : public ClassName<OcclusionTrackerTestImplThreadTypes> { \ + public: /* NOLINT(whitespace/indent) */ \ ClassName##ImplThreadOpaquePaints() \ : ClassName<OcclusionTrackerTestImplThreadTypes>(false) {} \ }; \ @@ -521,10 +521,10 @@ OcclusionTrackerTest<OcclusionTrackerTestImplThreadTypes>::GetHost() { RUN_TEST_IMPL_THREAD_OPAQUE_LAYERS(ClassName) template <class Types> -class OcclusionTrackerTestIdentityTransforms : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestIdentityTransforms + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestIdentityTransforms(bool opaque_layers) + explicit OcclusionTrackerTestIdentityTransforms(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { @@ -591,10 +591,10 @@ class OcclusionTrackerTestIdentityTransforms : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestIdentityTransforms); template <class Types> -class OcclusionTrackerTestQuadsMismatchLayer : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestQuadsMismatchLayer + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestQuadsMismatchLayer(bool opaque_layers) + explicit OcclusionTrackerTestQuadsMismatchLayer(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { gfx::Transform layer_transform; @@ -675,7 +675,7 @@ ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestQuadsMismatchLayer); template <class Types> class OcclusionTrackerTestRotatedChild : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestRotatedChild(bool opaque_layers) + explicit OcclusionTrackerTestRotatedChild(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { gfx::Transform layer_transform; @@ -748,7 +748,7 @@ ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestRotatedChild); template <class Types> class OcclusionTrackerTestTranslatedChild : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestTranslatedChild(bool opaque_layers) + explicit OcclusionTrackerTestTranslatedChild(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { gfx::Transform layer_transform; @@ -814,10 +814,10 @@ class OcclusionTrackerTestTranslatedChild : public OcclusionTrackerTest<Types> { ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestTranslatedChild); template <class Types> -class OcclusionTrackerTestChildInRotatedChild : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestChildInRotatedChild + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestChildInRotatedChild(bool opaque_layers) + explicit OcclusionTrackerTestChildInRotatedChild(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { gfx::Transform child_transform; @@ -918,10 +918,10 @@ class OcclusionTrackerTestChildInRotatedChild : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestChildInRotatedChild); template <class Types> -class OcclusionTrackerTestScaledRenderSurface : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestScaledRenderSurface + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestScaledRenderSurface(bool opaque_layers) + explicit OcclusionTrackerTestScaledRenderSurface(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { @@ -975,10 +975,10 @@ class OcclusionTrackerTestScaledRenderSurface : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestScaledRenderSurface); template <class Types> -class OcclusionTrackerTestVisitTargetTwoTimes : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestVisitTargetTwoTimes + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestVisitTargetTwoTimes(bool opaque_layers) + explicit OcclusionTrackerTestVisitTargetTwoTimes(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { gfx::Transform child_transform; @@ -1153,10 +1153,10 @@ class OcclusionTrackerTestVisitTargetTwoTimes : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestVisitTargetTwoTimes); template <class Types> -class OcclusionTrackerTestSurfaceRotatedOffAxis : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestSurfaceRotatedOffAxis + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestSurfaceRotatedOffAxis(bool opaque_layers) + explicit OcclusionTrackerTestSurfaceRotatedOffAxis(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { gfx::Transform child_transform; @@ -1211,10 +1211,10 @@ class OcclusionTrackerTestSurfaceRotatedOffAxis : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestSurfaceRotatedOffAxis); template <class Types> -class OcclusionTrackerTestSurfaceWithTwoOpaqueChildren : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestSurfaceWithTwoOpaqueChildren + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestSurfaceWithTwoOpaqueChildren(bool opaque_layers) + explicit OcclusionTrackerTestSurfaceWithTwoOpaqueChildren(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { gfx::Transform child_transform; @@ -1344,10 +1344,10 @@ class OcclusionTrackerTestSurfaceWithTwoOpaqueChildren : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestSurfaceWithTwoOpaqueChildren); template <class Types> -class OcclusionTrackerTestOverlappingSurfaceSiblings : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestOverlappingSurfaceSiblings + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestOverlappingSurfaceSiblings(bool opaque_layers) + explicit OcclusionTrackerTestOverlappingSurfaceSiblings(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { gfx::Transform child_transform; @@ -1461,10 +1461,10 @@ class OcclusionTrackerTestOverlappingSurfaceSiblings : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestOverlappingSurfaceSiblings); template <class Types> -class OcclusionTrackerTestOverlappingSurfaceSiblingsWithTwoTransforms : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestOverlappingSurfaceSiblingsWithTwoTransforms + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestOverlappingSurfaceSiblingsWithTwoTransforms( + explicit OcclusionTrackerTestOverlappingSurfaceSiblingsWithTwoTransforms( bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { @@ -1583,7 +1583,7 @@ ALL_OCCLUSIONTRACKER_TEST( template <class Types> class OcclusionTrackerTestFilters : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestFilters(bool opaque_layers) + explicit OcclusionTrackerTestFilters(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { gfx::Transform layer_transform; @@ -1681,10 +1681,10 @@ class OcclusionTrackerTestFilters : public OcclusionTrackerTest<Types> { ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestFilters); template <class Types> -class OcclusionTrackerTestReplicaDoesOcclude : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestReplicaDoesOcclude + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestReplicaDoesOcclude(bool opaque_layers) + explicit OcclusionTrackerTestReplicaDoesOcclude(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -1722,10 +1722,10 @@ class OcclusionTrackerTestReplicaDoesOcclude : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestReplicaDoesOcclude); template <class Types> -class OcclusionTrackerTestReplicaWithClipping : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestReplicaWithClipping + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestReplicaWithClipping(bool opaque_layers) + explicit OcclusionTrackerTestReplicaWithClipping(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -1766,7 +1766,7 @@ ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestReplicaWithClipping); template <class Types> class OcclusionTrackerTestReplicaWithMask : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestReplicaWithMask(bool opaque_layers) + explicit OcclusionTrackerTestReplicaWithMask(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -1804,10 +1804,10 @@ class OcclusionTrackerTestReplicaWithMask : public OcclusionTrackerTest<Types> { ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestReplicaWithMask); template <class Types> -class OcclusionTrackerTestLayerClipRectOutsideChild : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestLayerClipRectOutsideChild + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestLayerClipRectOutsideChild(bool opaque_layers) + explicit OcclusionTrackerTestLayerClipRectOutsideChild(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -1857,10 +1857,10 @@ class OcclusionTrackerTestLayerClipRectOutsideChild : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestLayerClipRectOutsideChild); template <class Types> -class OcclusionTrackerTestViewportRectOutsideChild : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestViewportRectOutsideChild + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestViewportRectOutsideChild(bool opaque_layers) + explicit OcclusionTrackerTestViewportRectOutsideChild(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -1909,10 +1909,10 @@ class OcclusionTrackerTestViewportRectOutsideChild : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestViewportRectOutsideChild); template <class Types> -class OcclusionTrackerTestLayerClipRectOverChild : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestLayerClipRectOverChild + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestLayerClipRectOverChild(bool opaque_layers) + explicit OcclusionTrackerTestLayerClipRectOverChild(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -1969,10 +1969,10 @@ class OcclusionTrackerTestLayerClipRectOverChild : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestLayerClipRectOverChild); template <class Types> -class OcclusionTrackerTestViewportRectOverChild : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestViewportRectOverChild + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestViewportRectOverChild(bool opaque_layers) + explicit OcclusionTrackerTestViewportRectOverChild(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -2018,10 +2018,10 @@ class OcclusionTrackerTestViewportRectOverChild : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestViewportRectOverChild); template <class Types> -class OcclusionTrackerTestLayerClipRectPartlyOverChild : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestLayerClipRectPartlyOverChild + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestLayerClipRectPartlyOverChild(bool opaque_layers) + explicit OcclusionTrackerTestLayerClipRectPartlyOverChild(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -2069,10 +2069,10 @@ class OcclusionTrackerTestLayerClipRectPartlyOverChild : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestLayerClipRectPartlyOverChild); template <class Types> -class OcclusionTrackerTestViewportRectPartlyOverChild : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestViewportRectPartlyOverChild + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestViewportRectPartlyOverChild(bool opaque_layers) + explicit OcclusionTrackerTestViewportRectPartlyOverChild(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -2134,10 +2134,10 @@ class OcclusionTrackerTestViewportRectPartlyOverChild : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestViewportRectPartlyOverChild); template <class Types> -class OcclusionTrackerTestViewportRectOverNothing : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestViewportRectOverNothing + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestViewportRectOverNothing(bool opaque_layers) + explicit OcclusionTrackerTestViewportRectOverNothing(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -2191,10 +2191,11 @@ class OcclusionTrackerTestViewportRectOverNothing : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestViewportRectOverNothing); template <class Types> -class OcclusionTrackerTestLayerClipRectForLayerOffOrigin : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestLayerClipRectForLayerOffOrigin + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestLayerClipRectForLayerOffOrigin(bool opaque_layers) + explicit OcclusionTrackerTestLayerClipRectForLayerOffOrigin( + bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -2226,10 +2227,10 @@ class OcclusionTrackerTestLayerClipRectForLayerOffOrigin : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestLayerClipRectForLayerOffOrigin); template <class Types> -class OcclusionTrackerTestOpaqueContentsRegionEmpty : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestOpaqueContentsRegionEmpty + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestOpaqueContentsRegionEmpty(bool opaque_layers) + explicit OcclusionTrackerTestOpaqueContentsRegionEmpty(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -2266,10 +2267,10 @@ class OcclusionTrackerTestOpaqueContentsRegionEmpty : MAIN_AND_IMPL_THREAD_TEST(OcclusionTrackerTestOpaqueContentsRegionEmpty); template <class Types> -class OcclusionTrackerTestOpaqueContentsRegionNonEmpty : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestOpaqueContentsRegionNonEmpty + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestOpaqueContentsRegionNonEmpty(bool opaque_layers) + explicit OcclusionTrackerTestOpaqueContentsRegionNonEmpty(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -2349,7 +2350,7 @@ MAIN_AND_IMPL_THREAD_TEST(OcclusionTrackerTestOpaqueContentsRegionNonEmpty); template <class Types> class OcclusionTrackerTest3dTransform : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTest3dTransform(bool opaque_layers) + explicit OcclusionTrackerTest3dTransform(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { gfx::Transform transform; @@ -2383,10 +2384,10 @@ class OcclusionTrackerTest3dTransform : public OcclusionTrackerTest<Types> { MAIN_AND_IMPL_THREAD_TEST(OcclusionTrackerTest3dTransform); template <class Types> -class OcclusionTrackerTestUnsorted3dLayers : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestUnsorted3dLayers + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestUnsorted3dLayers(bool opaque_layers) + explicit OcclusionTrackerTestUnsorted3dLayers(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { // Currently, The main thread layer iterator does not iterate over 3d items @@ -2433,10 +2434,10 @@ class OcclusionTrackerTestUnsorted3dLayers : MAIN_THREAD_TEST(OcclusionTrackerTestUnsorted3dLayers); template <class Types> -class OcclusionTrackerTestPerspectiveTransform : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestPerspectiveTransform + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestPerspectiveTransform(bool opaque_layers) + explicit OcclusionTrackerTestPerspectiveTransform(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { gfx::Transform transform; @@ -2476,10 +2477,11 @@ class OcclusionTrackerTestPerspectiveTransform : IMPL_THREAD_TEST(OcclusionTrackerTestPerspectiveTransform); template <class Types> -class OcclusionTrackerTestPerspectiveTransformBehindCamera : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestPerspectiveTransformBehindCamera + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestPerspectiveTransformBehindCamera(bool opaque_layers) + explicit OcclusionTrackerTestPerspectiveTransformBehindCamera( + bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { // This test is based on the platform/chromium/compositing/3d-corners.html @@ -2522,10 +2524,11 @@ class OcclusionTrackerTestPerspectiveTransformBehindCamera : IMPL_THREAD_TEST(OcclusionTrackerTestPerspectiveTransformBehindCamera); template <class Types> -class OcclusionTrackerTestLayerBehindCameraDoesNotOcclude : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestLayerBehindCameraDoesNotOcclude + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestLayerBehindCameraDoesNotOcclude(bool opaque_layers) + explicit OcclusionTrackerTestLayerBehindCameraDoesNotOcclude( + bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { gfx::Transform transform; @@ -2560,10 +2563,11 @@ class OcclusionTrackerTestLayerBehindCameraDoesNotOcclude : IMPL_THREAD_TEST(OcclusionTrackerTestLayerBehindCameraDoesNotOcclude); template <class Types> -class OcclusionTrackerTestLargePixelsOccludeInsideClipRect : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestLargePixelsOccludeInsideClipRect + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestLargePixelsOccludeInsideClipRect(bool opaque_layers) + explicit OcclusionTrackerTestLargePixelsOccludeInsideClipRect( + bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { gfx::Transform transform; @@ -2603,10 +2607,10 @@ class OcclusionTrackerTestLargePixelsOccludeInsideClipRect : IMPL_THREAD_TEST(OcclusionTrackerTestLargePixelsOccludeInsideClipRect); template <class Types> -class OcclusionTrackerTestAnimationOpacity1OnMainThread : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestAnimationOpacity1OnMainThread + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestAnimationOpacity1OnMainThread(bool opaque_layers) + explicit OcclusionTrackerTestAnimationOpacity1OnMainThread(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { // parent @@ -2732,10 +2736,10 @@ class OcclusionTrackerTestAnimationOpacity1OnMainThread : MAIN_THREAD_TEST(OcclusionTrackerTestAnimationOpacity1OnMainThread); template <class Types> -class OcclusionTrackerTestAnimationOpacity0OnMainThread : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestAnimationOpacity0OnMainThread + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestAnimationOpacity0OnMainThread(bool opaque_layers) + explicit OcclusionTrackerTestAnimationOpacity0OnMainThread(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -2853,10 +2857,11 @@ class OcclusionTrackerTestAnimationOpacity0OnMainThread : MAIN_THREAD_TEST(OcclusionTrackerTestAnimationOpacity0OnMainThread); template <class Types> -class OcclusionTrackerTestAnimationTranslateOnMainThread : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestAnimationTranslateOnMainThread + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestAnimationTranslateOnMainThread(bool opaque_layers) + explicit OcclusionTrackerTestAnimationTranslateOnMainThread( + bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -3004,10 +3009,11 @@ class OcclusionTrackerTestAnimationTranslateOnMainThread : MAIN_THREAD_TEST(OcclusionTrackerTestAnimationTranslateOnMainThread); template <class Types> -class OcclusionTrackerTestSurfaceOcclusionTranslatesToParent : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestSurfaceOcclusionTranslatesToParent + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestSurfaceOcclusionTranslatesToParent(bool opaque_layers) + explicit OcclusionTrackerTestSurfaceOcclusionTranslatesToParent( + bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { gfx::Transform surface_transform; @@ -3059,10 +3065,11 @@ MAIN_AND_IMPL_THREAD_TEST( OcclusionTrackerTestSurfaceOcclusionTranslatesToParent); template <class Types> -class OcclusionTrackerTestSurfaceOcclusionTranslatesWithClipping : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestSurfaceOcclusionTranslatesWithClipping + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestSurfaceOcclusionTranslatesWithClipping(bool opaque_layers) + explicit OcclusionTrackerTestSurfaceOcclusionTranslatesWithClipping( + bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -3097,7 +3104,7 @@ MAIN_AND_IMPL_THREAD_TEST( template <class Types> class OcclusionTrackerTestReplicaOccluded : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestReplicaOccluded(bool opaque_layers) + explicit OcclusionTrackerTestReplicaOccluded(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -3151,10 +3158,10 @@ class OcclusionTrackerTestReplicaOccluded : public OcclusionTrackerTest<Types> { ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestReplicaOccluded); template <class Types> -class OcclusionTrackerTestSurfaceWithReplicaUnoccluded : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestSurfaceWithReplicaUnoccluded + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestSurfaceWithReplicaUnoccluded(bool opaque_layers) + explicit OcclusionTrackerTestSurfaceWithReplicaUnoccluded(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -3211,10 +3218,11 @@ class OcclusionTrackerTestSurfaceWithReplicaUnoccluded : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestSurfaceWithReplicaUnoccluded); template <class Types> -class OcclusionTrackerTestSurfaceAndReplicaOccludedDifferently : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestSurfaceAndReplicaOccludedDifferently + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestSurfaceAndReplicaOccludedDifferently(bool opaque_layers) + explicit OcclusionTrackerTestSurfaceAndReplicaOccludedDifferently( + bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -3278,10 +3286,10 @@ ALL_OCCLUSIONTRACKER_TEST( OcclusionTrackerTestSurfaceAndReplicaOccludedDifferently); template <class Types> -class OcclusionTrackerTestSurfaceChildOfSurface : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestSurfaceChildOfSurface + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestSurfaceChildOfSurface(bool opaque_layers) + explicit OcclusionTrackerTestSurfaceChildOfSurface(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { // This test verifies that the surface cliprect does not end up empty and @@ -3362,10 +3370,11 @@ class OcclusionTrackerTestSurfaceChildOfSurface : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestSurfaceChildOfSurface); template <class Types> -class OcclusionTrackerTestTopmostSurfaceIsClippedToViewport : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestTopmostSurfaceIsClippedToViewport + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestTopmostSurfaceIsClippedToViewport(bool opaque_layers) + explicit OcclusionTrackerTestTopmostSurfaceIsClippedToViewport( + bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { // This test verifies that the top-most surface is considered occluded @@ -3422,10 +3431,10 @@ ALL_OCCLUSIONTRACKER_TEST( OcclusionTrackerTestTopmostSurfaceIsClippedToViewport); template <class Types> -class OcclusionTrackerTestSurfaceChildOfClippingSurface : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestSurfaceChildOfClippingSurface + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestSurfaceChildOfClippingSurface(bool opaque_layers) + explicit OcclusionTrackerTestSurfaceChildOfClippingSurface(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { // This test verifies that the surface cliprect does not end up empty and @@ -3499,10 +3508,10 @@ class OcclusionTrackerTestSurfaceChildOfClippingSurface : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestSurfaceChildOfClippingSurface); template <class Types> -class OcclusionTrackerTestDontOccludePixelsNeededForBackgroundFilter : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestDontOccludePixelsNeededForBackgroundFilter + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestDontOccludePixelsNeededForBackgroundFilter( + explicit OcclusionTrackerTestDontOccludePixelsNeededForBackgroundFilter( bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { @@ -3708,10 +3717,10 @@ ALL_OCCLUSIONTRACKER_TEST( OcclusionTrackerTestDontOccludePixelsNeededForBackgroundFilter); template <class Types> -class OcclusionTrackerTestTwoBackgroundFiltersReduceOcclusionTwice : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestTwoBackgroundFiltersReduceOcclusionTwice + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestTwoBackgroundFiltersReduceOcclusionTwice( + explicit OcclusionTrackerTestTwoBackgroundFiltersReduceOcclusionTwice( bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { @@ -3783,9 +3792,10 @@ ALL_OCCLUSIONTRACKER_TEST( OcclusionTrackerTestTwoBackgroundFiltersReduceOcclusionTwice); template <class Types> -class OcclusionTrackerTestDontOccludePixelsNeededForBackgroundFilterWithClip : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestDontOccludePixelsNeededForBackgroundFilterWithClip + : public OcclusionTrackerTest<Types> { protected: + explicit OcclusionTrackerTestDontOccludePixelsNeededForBackgroundFilterWithClip( bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} @@ -4013,10 +4023,10 @@ ALL_OCCLUSIONTRACKER_TEST( OcclusionTrackerTestDontOccludePixelsNeededForBackgroundFilterWithClip); template <class Types> -class OcclusionTrackerTestDontReduceOcclusionBelowBackgroundFilter : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestDontReduceOcclusionBelowBackgroundFilter + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestDontReduceOcclusionBelowBackgroundFilter( + explicit OcclusionTrackerTestDontReduceOcclusionBelowBackgroundFilter( bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { @@ -4091,10 +4101,10 @@ ALL_OCCLUSIONTRACKER_TEST( OcclusionTrackerTestDontReduceOcclusionBelowBackgroundFilter); template <class Types> -class OcclusionTrackerTestDontReduceOcclusionIfBackgroundFilterIsOccluded : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestDontReduceOcclusionIfBackgroundFilterIsOccluded + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestDontReduceOcclusionIfBackgroundFilterIsOccluded( + explicit OcclusionTrackerTestDontReduceOcclusionIfBackgroundFilterIsOccluded( bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { @@ -4182,10 +4192,10 @@ ALL_OCCLUSIONTRACKER_TEST( OcclusionTrackerTestDontReduceOcclusionIfBackgroundFilterIsOccluded); template <class Types> -class - OcclusionTrackerTestReduceOcclusionWhenBackgroundFilterIsPartiallyOccluded : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestReduceOcclusionWhenBackgroundFilterIsPartiallyOccluded + : public OcclusionTrackerTest<Types> { protected: + explicit OcclusionTrackerTestReduceOcclusionWhenBackgroundFilterIsPartiallyOccluded( bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} @@ -4299,10 +4309,10 @@ ALL_OCCLUSIONTRACKER_TEST( OcclusionTrackerTestReduceOcclusionWhenBackgroundFilterIsPartiallyOccluded); template <class Types> -class OcclusionTrackerTestMinimumTrackingSize : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestMinimumTrackingSize + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestMinimumTrackingSize(bool opaque_layers) + explicit OcclusionTrackerTestMinimumTrackingSize(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { gfx::Size tracking_size(100, 100); @@ -4346,10 +4356,11 @@ class OcclusionTrackerTestMinimumTrackingSize : ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestMinimumTrackingSize); template <class Types> -class OcclusionTrackerTestViewportClipIsExternalOcclusion : - public OcclusionTrackerTest<Types> { +class OcclusionTrackerTestViewportClipIsExternalOcclusion + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestViewportClipIsExternalOcclusion(bool opaque_layers) + explicit OcclusionTrackerTestViewportClipIsExternalOcclusion( + bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( @@ -4422,11 +4433,13 @@ class OcclusionTrackerTestViewportClipIsExternalOcclusion : }; ALL_OCCLUSIONTRACKER_TEST( - OcclusionTrackerTestViewportClipIsExternalOcclusion) template <class Types> -class OcclusionTrackerTestLayerClipIsExternalOcclusion : - public OcclusionTrackerTest<Types> { + OcclusionTrackerTestViewportClipIsExternalOcclusion) + +template <class Types> +class OcclusionTrackerTestLayerClipIsExternalOcclusion + : public OcclusionTrackerTest<Types> { protected: - OcclusionTrackerTestLayerClipIsExternalOcclusion(bool opaque_layers) + explicit OcclusionTrackerTestLayerClipIsExternalOcclusion(bool opaque_layers) : OcclusionTrackerTest<Types>(opaque_layers) {} void RunMyTest() { typename Types::ContentLayerType* parent = this->CreateRoot( |