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

Unified Diff: cc/contents_scaling_layer.cc

Issue 12603013: Part 10 of cc/ directory shuffles: layers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/contents_scaling_layer.h ('k') | cc/contents_scaling_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/contents_scaling_layer.cc
diff --git a/cc/contents_scaling_layer.cc b/cc/contents_scaling_layer.cc
deleted file mode 100644
index 3b72d3fbb4e19b6e45726fab59259364bef456f2..0000000000000000000000000000000000000000
--- a/cc/contents_scaling_layer.cc
+++ /dev/null
@@ -1,50 +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/contents_scaling_layer.h"
-#include "ui/gfx/size_conversions.h"
-
-namespace cc {
-
-gfx::Size ContentsScalingLayer::ComputeContentBoundsForScale(
- float scale_x,
- float scale_y) const {
- return gfx::ToCeiledSize(gfx::ScaleSize(bounds(), scale_x, scale_y));
-}
-
-ContentsScalingLayer::ContentsScalingLayer()
- : last_update_contents_scale_x_(0.f),
- last_update_contents_scale_y_(0.f) {}
-
-ContentsScalingLayer::~ContentsScalingLayer() {
-}
-
-void ContentsScalingLayer::CalculateContentsScale(
- float ideal_contents_scale,
- bool animating_transform_to_screen,
- float* contents_scale_x,
- float* contents_scale_y,
- gfx::Size* content_bounds) {
- *contents_scale_x = ideal_contents_scale;
- *contents_scale_y = ideal_contents_scale;
- *content_bounds = ComputeContentBoundsForScale(
- ideal_contents_scale,
- ideal_contents_scale);
-}
-
-void ContentsScalingLayer::Update(
- ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion,
- RenderingStats* stats) {
- if (draw_properties().contents_scale_x == last_update_contents_scale_x_ &&
- draw_properties().contents_scale_y == last_update_contents_scale_y_)
- return;
-
- last_update_contents_scale_x_ = draw_properties().contents_scale_x;
- last_update_contents_scale_y_ = draw_properties().contents_scale_y;
- // Invalidate the whole layer if scale changed.
- SetNeedsDisplayRect(gfx::Rect(bounds()));
-}
-
-} // namespace cc
« no previous file with comments | « cc/contents_scaling_layer.h ('k') | cc/contents_scaling_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698