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

Unified Diff: cc/blink/web_layer_impl_fixed_bounds.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/blink/web_layer_impl_fixed_bounds.h ('k') | cc/blink/web_layer_impl_fixed_bounds_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/blink/web_layer_impl_fixed_bounds.cc
diff --git a/cc/blink/web_layer_impl_fixed_bounds.cc b/cc/blink/web_layer_impl_fixed_bounds.cc
deleted file mode 100644
index e7ecb34907329a87ca901cd2a2e74722f7189843..0000000000000000000000000000000000000000
--- a/cc/blink/web_layer_impl_fixed_bounds.cc
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright 2014 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/blink/web_layer_impl_fixed_bounds.h"
-
-#include "cc/layers/layer.h"
-#include "third_party/WebKit/public/platform/WebFloatPoint.h"
-#include "third_party/WebKit/public/platform/WebSize.h"
-#include "third_party/skia/include/utils/SkMatrix44.h"
-
-using cc::Layer;
-
-namespace cc_blink {
-
-WebLayerImplFixedBounds::WebLayerImplFixedBounds() {
-}
-
-WebLayerImplFixedBounds::WebLayerImplFixedBounds(scoped_refptr<Layer> layer)
- : WebLayerImpl(layer) {
-}
-
-WebLayerImplFixedBounds::~WebLayerImplFixedBounds() {
-}
-
-void WebLayerImplFixedBounds::invalidateRect(const blink::WebRect& rect) {
- // Partial invalidations seldom occur for such layers.
- // Simply invalidate the whole layer to avoid transformation of coordinates.
- invalidate();
-}
-
-void WebLayerImplFixedBounds::setTransformOrigin(
- const blink::WebFloatPoint3D& transform_origin) {
- if (transform_origin != this->transformOrigin()) {
- layer_->SetTransformOrigin(transform_origin);
- UpdateLayerBoundsAndTransform();
- }
-}
-
-void WebLayerImplFixedBounds::setBounds(const blink::WebSize& bounds) {
- if (original_bounds_ != gfx::Size(bounds)) {
- original_bounds_ = bounds;
- UpdateLayerBoundsAndTransform();
- }
-}
-
-blink::WebSize WebLayerImplFixedBounds::bounds() const {
- return original_bounds_;
-}
-
-void WebLayerImplFixedBounds::setTransform(const SkMatrix44& matrix) {
- gfx::Transform transform;
- transform.matrix() = matrix;
- SetTransformInternal(transform);
-}
-
-SkMatrix44 WebLayerImplFixedBounds::transform() const {
- return original_transform_.matrix();
-}
-
-void WebLayerImplFixedBounds::SetFixedBounds(gfx::Size fixed_bounds) {
- if (fixed_bounds_ != fixed_bounds) {
- fixed_bounds_ = fixed_bounds;
- UpdateLayerBoundsAndTransform();
- }
-}
-
-void WebLayerImplFixedBounds::SetTransformInternal(
- const gfx::Transform& transform) {
- if (original_transform_ != transform) {
- original_transform_ = transform;
- UpdateLayerBoundsAndTransform();
- }
-}
-
-void WebLayerImplFixedBounds::UpdateLayerBoundsAndTransform() {
- if (fixed_bounds_.IsEmpty() || original_bounds_.IsEmpty() ||
- fixed_bounds_ == original_bounds_ ||
- // For now fall back to non-fixed bounds for non-zero transform origin.
- // TODO(wangxianzhu): Support non-zero anchor point for fixed bounds.
- transformOrigin().x ||
- transformOrigin().y) {
- layer_->SetBounds(original_bounds_);
- layer_->SetTransform(original_transform_);
- return;
- }
-
- layer_->SetBounds(fixed_bounds_);
-
- // Apply bounds scale (bounds/fixed_bounds) over original transform.
- gfx::Transform transform_with_bounds_scale(original_transform_);
- float bounds_scale_x =
- static_cast<float>(original_bounds_.width()) / fixed_bounds_.width();
- float bounds_scale_y =
- static_cast<float>(original_bounds_.height()) / fixed_bounds_.height();
- transform_with_bounds_scale.Scale(bounds_scale_x, bounds_scale_y);
- layer_->SetTransform(transform_with_bounds_scale);
-}
-
-} // namespace cc_blink
« no previous file with comments | « cc/blink/web_layer_impl_fixed_bounds.h ('k') | cc/blink/web_layer_impl_fixed_bounds_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698