Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(990)

Unified Diff: cc/layers/solid_color_layer_impl.cc

Issue 1057283003: Remove parts of //cc we aren't using (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/solid_color_layer_impl.h ('k') | cc/layers/solid_color_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/solid_color_layer_impl.cc
diff --git a/cc/layers/solid_color_layer_impl.cc b/cc/layers/solid_color_layer_impl.cc
deleted file mode 100644
index 276249744e83e306253a735004019f95fca0e4a7..0000000000000000000000000000000000000000
--- a/cc/layers/solid_color_layer_impl.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "cc/layers/solid_color_layer_impl.h"
-
-#include <algorithm>
-
-#include "cc/layers/append_quads_data.h"
-#include "cc/quads/solid_color_draw_quad.h"
-#include "cc/trees/occlusion.h"
-
-namespace cc {
-
-namespace {
-const int kSolidQuadTileSize = 256;
-}
-
-SolidColorLayerImpl::SolidColorLayerImpl(LayerTreeImpl* tree_impl, int id)
- : LayerImpl(tree_impl, id) {
-}
-
-SolidColorLayerImpl::~SolidColorLayerImpl() {}
-
-scoped_ptr<LayerImpl> SolidColorLayerImpl::CreateLayerImpl(
- LayerTreeImpl* tree_impl) {
- return SolidColorLayerImpl::Create(tree_impl, id());
-}
-
-void SolidColorLayerImpl::AppendSolidQuads(
- RenderPass* render_pass,
- const Occlusion& occlusion_in_content_space,
- SharedQuadState* shared_quad_state,
- const gfx::Rect& visible_content_rect,
- SkColor color,
- AppendQuadsData* append_quads_data) {
- // We create a series of smaller quads instead of just one large one so that
- // the culler can reduce the total pixels drawn.
- int right = visible_content_rect.right();
- int bottom = visible_content_rect.bottom();
- for (int x = visible_content_rect.x(); x < visible_content_rect.right();
- x += kSolidQuadTileSize) {
- for (int y = visible_content_rect.y(); y < visible_content_rect.bottom();
- y += kSolidQuadTileSize) {
- gfx::Rect quad_rect(x,
- y,
- std::min(right - x, kSolidQuadTileSize),
- std::min(bottom - y, kSolidQuadTileSize));
- gfx::Rect visible_quad_rect =
- occlusion_in_content_space.GetUnoccludedContentRect(quad_rect);
- if (visible_quad_rect.IsEmpty())
- continue;
-
- append_quads_data->visible_content_area +=
- visible_quad_rect.width() * visible_quad_rect.height();
-
- SolidColorDrawQuad* quad =
- render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
- quad->SetNew(
- shared_quad_state, quad_rect, visible_quad_rect, color, false);
- }
- }
-}
-
-void SolidColorLayerImpl::AppendQuads(
- RenderPass* render_pass,
- AppendQuadsData* append_quads_data) {
- SharedQuadState* shared_quad_state =
- render_pass->CreateAndAppendSharedQuadState();
- PopulateSharedQuadState(shared_quad_state);
-
- AppendDebugBorderQuad(
- render_pass, content_bounds(), shared_quad_state, append_quads_data);
-
- // TODO(hendrikw): We need to pass the visible content rect rather than
- // |content_bounds()| here.
- AppendSolidQuads(render_pass, draw_properties().occlusion_in_content_space,
- shared_quad_state, gfx::Rect(content_bounds()),
- background_color(), append_quads_data);
-}
-
-const char* SolidColorLayerImpl::LayerTypeAsString() const {
- return "cc::SolidColorLayerImpl";
-}
-
-} // namespace cc
« no previous file with comments | « cc/layers/solid_color_layer_impl.h ('k') | cc/layers/solid_color_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698