diff options
Diffstat (limited to 'cc/quads')
-rw-r--r-- | cc/quads/checkerboard_draw_quad.h | 3 | ||||
-rw-r--r-- | cc/quads/debug_border_draw_quad.h | 3 | ||||
-rw-r--r-- | cc/quads/draw_quad.cc | 4 | ||||
-rw-r--r-- | cc/quads/draw_quad.h | 2 | ||||
-rw-r--r-- | cc/quads/draw_quad_unittest.cc | 16 | ||||
-rw-r--r-- | cc/quads/io_surface_draw_quad.cc | 2 | ||||
-rw-r--r-- | cc/quads/io_surface_draw_quad.h | 3 | ||||
-rw-r--r-- | cc/quads/render_pass.h | 9 | ||||
-rw-r--r-- | cc/quads/render_pass_draw_quad.cc | 10 | ||||
-rw-r--r-- | cc/quads/render_pass_draw_quad.h | 2 | ||||
-rw-r--r-- | cc/quads/render_pass_unittest.cc | 3 | ||||
-rw-r--r-- | cc/quads/shared_quad_state.h | 2 | ||||
-rw-r--r-- | cc/quads/solid_color_draw_quad.h | 3 | ||||
-rw-r--r-- | cc/quads/stream_video_draw_quad.h | 3 | ||||
-rw-r--r-- | cc/quads/texture_draw_quad.h | 3 | ||||
-rw-r--r-- | cc/quads/tile_draw_quad.h | 3 | ||||
-rw-r--r-- | cc/quads/yuv_video_draw_quad.h | 3 |
17 files changed, 42 insertions, 32 deletions
diff --git a/cc/quads/checkerboard_draw_quad.h b/cc/quads/checkerboard_draw_quad.h index 53d1c5e..b2ed876 100644 --- a/cc/quads/checkerboard_draw_quad.h +++ b/cc/quads/checkerboard_draw_quad.h @@ -33,10 +33,11 @@ class CC_EXPORT CheckerboardDrawQuad : public DrawQuad { OVERRIDE; static const CheckerboardDrawQuad* MaterialCast(const DrawQuad*); + private: CheckerboardDrawQuad(); }; -} +} // namespace cc #endif // CC_QUADS_CHECKERBOARD_DRAW_QUAD_H_ diff --git a/cc/quads/debug_border_draw_quad.h b/cc/quads/debug_border_draw_quad.h index 80484368..2f4b3ca 100644 --- a/cc/quads/debug_border_draw_quad.h +++ b/cc/quads/debug_border_draw_quad.h @@ -36,10 +36,11 @@ class CC_EXPORT DebugBorderDrawQuad : public DrawQuad { OVERRIDE; static const DebugBorderDrawQuad* MaterialCast(const DrawQuad*); + private: DebugBorderDrawQuad(); }; -} +} // namespace cc #endif // CC_QUADS_DEBUG_BORDER_DRAW_QUAD_H_ diff --git a/cc/quads/draw_quad.cc b/cc/quads/draw_quad.cc index 22271d6..0250481 100644 --- a/cc/quads/draw_quad.cc +++ b/cc/quads/draw_quad.cc @@ -16,12 +16,10 @@ #include "cc/quads/yuv_video_draw_quad.h" namespace { - template<typename T> T* TypedCopy(const cc::DrawQuad* other) { return new T(*T::MaterialCast(other)); } - -} +} // namespace namespace cc { diff --git a/cc/quads/draw_quad.h b/cc/quads/draw_quad.h index 2636a07..05924f1 100644 --- a/cc/quads/draw_quad.h +++ b/cc/quads/draw_quad.h @@ -114,6 +114,6 @@ class CC_EXPORT DrawQuad { bool needs_blending); }; -} +} // namespace cc #endif // CC_QUADS_DRAW_QUAD_H_ diff --git a/cc/quads/draw_quad_unittest.cc b/cc/quads/draw_quad_unittest.cc index 281da3b..3eefdc9 100644 --- a/cc/quads/draw_quad_unittest.cc +++ b/cc/quads/draw_quad_unittest.cc @@ -4,6 +4,8 @@ #include "cc/quads/draw_quad.h" +#include <algorithm> + #include "base/bind.h" #include "cc/base/math_util.h" #include "cc/quads/checkerboard_draw_quad.h" @@ -497,13 +499,13 @@ TEST(DrawQuadTest, ClipTextureDrawQuad) { shared_state->clip_rect = gfx::Rect(50, 70, 30, 20); // The original quad is 'ABCD', the clipped quad is 'abcd': - //40 50 90 - // B--:-------C 60 - // | b----c -|-70 - // | | | | - // | a----d -|-90 - // | | - // A----------D 120 + // 40 50 90 + // B--:-------C 60 + // | b----c -|-70 + // | | | | + // | a----d -|-90 + // | | + // A----------D 120 // UV and vertex opacity are stored per vertex on the parent rectangle 'ABCD'. // This is the UV value for vertex 'B'. diff --git a/cc/quads/io_surface_draw_quad.cc b/cc/quads/io_surface_draw_quad.cc index ac107c1..eb4aa20 100644 --- a/cc/quads/io_surface_draw_quad.cc +++ b/cc/quads/io_surface_draw_quad.cc @@ -26,7 +26,7 @@ void IOSurfaceDrawQuad::SetNew(const SharedQuadState* shared_quad_state, gfx::Rect visible_rect = rect; bool needs_blending = false; DrawQuad::SetAll(shared_quad_state, DrawQuad::IO_SURFACE_CONTENT, rect, - opaque_rect, visible_rect, needs_blending); + opaque_rect, visible_rect, needs_blending); this->io_surface_size = io_surface_size; this->io_surface_texture_id = io_surface_texture_id; this->orientation = orientation; diff --git a/cc/quads/io_surface_draw_quad.h b/cc/quads/io_surface_draw_quad.h index d0559e2..38dabf8 100644 --- a/cc/quads/io_surface_draw_quad.h +++ b/cc/quads/io_surface_draw_quad.h @@ -45,10 +45,11 @@ class CC_EXPORT IOSurfaceDrawQuad : public DrawQuad { OVERRIDE; static const IOSurfaceDrawQuad* MaterialCast(const DrawQuad*); + private: IOSurfaceDrawQuad(); }; -} +} // namespace cc #endif // CC_QUADS_IO_SURFACE_DRAW_QUAD_H_ diff --git a/cc/quads/render_pass.h b/cc/quads/render_pass.h index 154b02c5..bfd0d83 100644 --- a/cc/quads/render_pass.h +++ b/cc/quads/render_pass.h @@ -5,6 +5,7 @@ #ifndef CC_QUADS_RENDER_PASS_H_ #define CC_QUADS_RENDER_PASS_H_ +#include <utility> #include <vector> #include "base/basictypes.h" @@ -45,7 +46,7 @@ class CC_EXPORT RenderPass { int layer_id; int index; - Id(int layer_id, int index) : layer_id(layer_id), index(index) {} + Id(int layer_id, int index) : layer_id(layer_id), index(index) {} bool operator==(const Id& other) const { return layer_id == other.layer_id && index == other.index; @@ -105,7 +106,7 @@ class CC_EXPORT RenderPass { DISALLOW_COPY_AND_ASSIGN(RenderPass); }; -} // namespace cc +} // namespace cc namespace BASE_HASH_NAMESPACE { #if defined(COMPILER_MSVC) @@ -124,12 +125,12 @@ struct hash<cc::RenderPass::Id> { }; #else #error define a hash function for your compiler -#endif // COMPILER +#endif // COMPILER } namespace cc { typedef ScopedPtrVector<RenderPass> RenderPassList; typedef base::hash_map<RenderPass::Id, RenderPass*> RenderPassIdHashMap; -} // namespace cc +} // namespace cc #endif // CC_QUADS_RENDER_PASS_H_ diff --git a/cc/quads/render_pass_draw_quad.cc b/cc/quads/render_pass_draw_quad.cc index b4ec337..7ee1a88 100644 --- a/cc/quads/render_pass_draw_quad.cc +++ b/cc/quads/render_pass_draw_quad.cc @@ -40,8 +40,8 @@ void RenderPassDrawQuad::SetNew( const WebKit::WebFilterOperations& filters, skia::RefPtr<SkImageFilter> filter, const WebKit::WebFilterOperations& background_filters) { - DCHECK(render_pass_id.layer_id > 0); - DCHECK(render_pass_id.index >= 0); + DCHECK_GT(render_pass_id.layer_id, 0); + DCHECK_GE(render_pass_id.index, 0); gfx::Rect opaque_rect; gfx::Rect visible_rect = rect; @@ -66,8 +66,8 @@ void RenderPassDrawQuad::SetAll( const WebKit::WebFilterOperations& filters, skia::RefPtr<SkImageFilter> filter, const WebKit::WebFilterOperations& background_filters) { - DCHECK(render_pass_id.layer_id > 0); - DCHECK(render_pass_id.index >= 0); + DCHECK_GT(render_pass_id.layer_id, 0); + DCHECK_GE(render_pass_id.index, 0); DrawQuad::SetAll(shared_quad_state, DrawQuad::RENDER_PASS, rect, opaque_rect, visible_rect, needs_blending); @@ -88,7 +88,7 @@ void RenderPassDrawQuad::IterateResources( const RenderPassDrawQuad* RenderPassDrawQuad::MaterialCast( const DrawQuad* quad) { - DCHECK(quad->material == DrawQuad::RENDER_PASS); + DCHECK_EQ(quad->material, DrawQuad::RENDER_PASS); return static_cast<const RenderPassDrawQuad*>(quad); } diff --git a/cc/quads/render_pass_draw_quad.h b/cc/quads/render_pass_draw_quad.h index ca79755..303750f 100644 --- a/cc/quads/render_pass_draw_quad.h +++ b/cc/quads/render_pass_draw_quad.h @@ -74,6 +74,6 @@ class CC_EXPORT RenderPassDrawQuad : public DrawQuad { RenderPassDrawQuad(); }; -} +} // namespace cc #endif // CC_QUADS_RENDER_PASS_DRAW_QUAD_H_ diff --git a/cc/quads/render_pass_unittest.cc b/cc/quads/render_pass_unittest.cc index e487784..f2271b5 100644 --- a/cc/quads/render_pass_unittest.cc +++ b/cc/quads/render_pass_unittest.cc @@ -19,7 +19,8 @@ namespace cc { namespace { struct RenderPassSize { - // If you add a new field to this class, make sure to add it to the copy() tests. + // If you add a new field to this class, make sure to add it to the + // Copy() tests. RenderPass::Id id; QuadList quad_list; SharedQuadStateList shared_quad_state_list; diff --git a/cc/quads/shared_quad_state.h b/cc/quads/shared_quad_state.h index c7c1bc0..384fa81 100644 --- a/cc/quads/shared_quad_state.h +++ b/cc/quads/shared_quad_state.h @@ -39,6 +39,6 @@ class CC_EXPORT SharedQuadState { SharedQuadState(); }; -} +} // namespace cc #endif // CC_QUADS_SHARED_QUAD_STATE_H_ diff --git a/cc/quads/solid_color_draw_quad.h b/cc/quads/solid_color_draw_quad.h index a300063..690f816 100644 --- a/cc/quads/solid_color_draw_quad.h +++ b/cc/quads/solid_color_draw_quad.h @@ -33,10 +33,11 @@ class CC_EXPORT SolidColorDrawQuad : public DrawQuad { OVERRIDE; static const SolidColorDrawQuad* MaterialCast(const DrawQuad*); + private: SolidColorDrawQuad(); }; -} +} // namespace cc #endif // CC_QUADS_SOLID_COLOR_DRAW_QUAD_H_ diff --git a/cc/quads/stream_video_draw_quad.h b/cc/quads/stream_video_draw_quad.h index bfbcdf4..e6a46b4 100644 --- a/cc/quads/stream_video_draw_quad.h +++ b/cc/quads/stream_video_draw_quad.h @@ -37,10 +37,11 @@ class CC_EXPORT StreamVideoDrawQuad : public DrawQuad { OVERRIDE; static const StreamVideoDrawQuad* MaterialCast(const DrawQuad*); + private: StreamVideoDrawQuad(); }; -} +} // namespace cc #endif // CC_QUADS_STREAM_VIDEO_DRAW_QUAD_H_ diff --git a/cc/quads/texture_draw_quad.h b/cc/quads/texture_draw_quad.h index c888eca..0b35568 100644 --- a/cc/quads/texture_draw_quad.h +++ b/cc/quads/texture_draw_quad.h @@ -51,10 +51,11 @@ class CC_EXPORT TextureDrawQuad : public DrawQuad { static const TextureDrawQuad* MaterialCast(const DrawQuad*); bool PerformClipping(); + private: TextureDrawQuad(); }; -} +} // namespace cc #endif // CC_QUADS_TEXTURE_DRAW_QUAD_H_ diff --git a/cc/quads/tile_draw_quad.h b/cc/quads/tile_draw_quad.h index 74c3698..e39a281 100644 --- a/cc/quads/tile_draw_quad.h +++ b/cc/quads/tile_draw_quad.h @@ -45,10 +45,11 @@ class CC_EXPORT TileDrawQuad : public DrawQuad { OVERRIDE; static const TileDrawQuad* MaterialCast(const DrawQuad*); + private: TileDrawQuad(); }; -} +} // namespace cc #endif // CC_QUADS_TILE_DRAW_QUAD_H_ diff --git a/cc/quads/yuv_video_draw_quad.h b/cc/quads/yuv_video_draw_quad.h index dde1459..8885a5a 100644 --- a/cc/quads/yuv_video_draw_quad.h +++ b/cc/quads/yuv_video_draw_quad.h @@ -46,10 +46,11 @@ class CC_EXPORT YUVVideoDrawQuad : public DrawQuad { OVERRIDE; static const YUVVideoDrawQuad* MaterialCast(const DrawQuad*); + private: YUVVideoDrawQuad(); }; -} +} // namespace cc #endif // CC_QUADS_YUV_VIDEO_DRAW_QUAD_H_ |