| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/compositor/layer.h" | 5 #include "ui/compositor/layer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 background_blur_radius_(0), | 54 background_blur_radius_(0), |
| 55 layer_saturation_(0.0f), | 55 layer_saturation_(0.0f), |
| 56 layer_brightness_(0.0f), | 56 layer_brightness_(0.0f), |
| 57 layer_grayscale_(0.0f), | 57 layer_grayscale_(0.0f), |
| 58 layer_inverted_(false), | 58 layer_inverted_(false), |
| 59 layer_mask_(NULL), | 59 layer_mask_(NULL), |
| 60 layer_mask_back_link_(NULL), | 60 layer_mask_back_link_(NULL), |
| 61 zoom_(1), | 61 zoom_(1), |
| 62 zoom_inset_(0), | 62 zoom_inset_(0), |
| 63 delegate_(NULL), | 63 delegate_(NULL), |
| 64 owner_(NULL), |
| 64 cc_layer_(NULL), | 65 cc_layer_(NULL), |
| 65 scale_content_(true), | 66 scale_content_(true), |
| 66 device_scale_factor_(1.0f) { | 67 device_scale_factor_(1.0f) { |
| 67 CreateWebLayer(); | 68 CreateWebLayer(); |
| 68 } | 69 } |
| 69 | 70 |
| 70 Layer::Layer(LayerType type) | 71 Layer::Layer(LayerType type) |
| 71 : type_(type), | 72 : type_(type), |
| 72 compositor_(NULL), | 73 compositor_(NULL), |
| 73 parent_(NULL), | 74 parent_(NULL), |
| 74 visible_(true), | 75 visible_(true), |
| 75 force_render_surface_(false), | 76 force_render_surface_(false), |
| 76 fills_bounds_opaquely_(true), | 77 fills_bounds_opaquely_(true), |
| 77 background_blur_radius_(0), | 78 background_blur_radius_(0), |
| 78 layer_saturation_(0.0f), | 79 layer_saturation_(0.0f), |
| 79 layer_brightness_(0.0f), | 80 layer_brightness_(0.0f), |
| 80 layer_grayscale_(0.0f), | 81 layer_grayscale_(0.0f), |
| 81 layer_inverted_(false), | 82 layer_inverted_(false), |
| 82 layer_mask_(NULL), | 83 layer_mask_(NULL), |
| 83 layer_mask_back_link_(NULL), | 84 layer_mask_back_link_(NULL), |
| 84 zoom_(1), | 85 zoom_(1), |
| 85 zoom_inset_(0), | 86 zoom_inset_(0), |
| 86 delegate_(NULL), | 87 delegate_(NULL), |
| 88 owner_(NULL), |
| 87 cc_layer_(NULL), | 89 cc_layer_(NULL), |
| 88 scale_content_(true), | 90 scale_content_(true), |
| 89 device_scale_factor_(1.0f) { | 91 device_scale_factor_(1.0f) { |
| 90 CreateWebLayer(); | 92 CreateWebLayer(); |
| 91 } | 93 } |
| 92 | 94 |
| 93 Layer::~Layer() { | 95 Layer::~Layer() { |
| 94 // Destroying the animator may cause observers to use the layer (and | 96 // Destroying the animator may cause observers to use the layer (and |
| 95 // indirectly the WebLayer). Destroy the animator first so that the WebLayer | 97 // indirectly the WebLayer). Destroy the animator first so that the WebLayer |
| 96 // is still around. | 98 // is still around. |
| (...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 cc_layer_->SetBounds(ConvertSizeToPixel(this, size)); | 939 cc_layer_->SetBounds(ConvertSizeToPixel(this, size)); |
| 938 } | 940 } |
| 939 | 941 |
| 940 void Layer::RecomputePosition() { | 942 void Layer::RecomputePosition() { |
| 941 cc_layer_->SetPosition(gfx::ScalePoint( | 943 cc_layer_->SetPosition(gfx::ScalePoint( |
| 942 gfx::PointF(bounds_.x(), bounds_.y()), | 944 gfx::PointF(bounds_.x(), bounds_.y()), |
| 943 device_scale_factor_)); | 945 device_scale_factor_)); |
| 944 } | 946 } |
| 945 | 947 |
| 946 } // namespace ui | 948 } // namespace ui |
| OLD | NEW |