| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/android/compositor/layer/toolbar_layer.h" | 5 #include "chrome/browser/android/compositor/layer/toolbar_layer.h" |
| 6 | 6 |
| 7 #include "cc/layers/solid_color_layer.h" | 7 #include "cc/layers/solid_color_layer.h" |
| 8 #include "cc/layers/ui_resource_layer.h" | 8 #include "cc/layers/ui_resource_layer.h" |
| 9 #include "content/public/browser/android/compositor.h" | 9 #include "content/public/browser/android/compositor.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 // This layer effectively draws over the space it takes for shadows. Set the | 34 // This layer effectively draws over the space it takes for shadows. Set the |
| 35 // bounds to the non-shadow size so that other things can properly line up. | 35 // bounds to the non-shadow size so that other things can properly line up. |
| 36 layer_->SetBounds(resource->padding.size()); | 36 layer_->SetBounds(resource->padding.size()); |
| 37 | 37 |
| 38 bitmap_layer_->SetUIResourceId(resource->ui_resource->id()); | 38 bitmap_layer_->SetUIResourceId(resource->ui_resource->id()); |
| 39 bitmap_layer_->SetBounds(resource->size); | 39 bitmap_layer_->SetBounds(resource->size); |
| 40 | 40 |
| 41 anonymize_layer_->SetHideLayerAndSubtree(!anonymize); | 41 anonymize_layer_->SetHideLayerAndSubtree(!anonymize); |
| 42 if (anonymize) { | 42 if (anonymize) { |
| 43 anonymize_layer_->SetPosition(resource->aperture.origin()); | 43 anonymize_layer_->SetPosition(gfx::PointF(resource->aperture.origin())); |
| 44 anonymize_layer_->SetBounds(resource->aperture.size()); | 44 anonymize_layer_->SetBounds(resource->aperture.size()); |
| 45 anonymize_layer_->SetBackgroundColor(toolbar_textbox_background_color); | 45 anonymize_layer_->SetBackgroundColor(toolbar_textbox_background_color); |
| 46 } | 46 } |
| 47 | 47 |
| 48 debug_layer_->SetBounds(resource->size); | 48 debug_layer_->SetBounds(resource->size); |
| 49 if (show_debug && !debug_layer_->parent()) | 49 if (show_debug && !debug_layer_->parent()) |
| 50 layer_->AddChild(debug_layer_); | 50 layer_->AddChild(debug_layer_); |
| 51 else if (!show_debug && debug_layer_->parent()) | 51 else if (!show_debug && debug_layer_->parent()) |
| 52 debug_layer_->RemoveFromParent(); | 52 debug_layer_->RemoveFromParent(); |
| 53 | 53 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 debug_layer_->SetIsDrawable(true); | 126 debug_layer_->SetIsDrawable(true); |
| 127 debug_layer_->SetBackgroundColor(SK_ColorGREEN); | 127 debug_layer_->SetBackgroundColor(SK_ColorGREEN); |
| 128 debug_layer_->SetOpacity(0.5f); | 128 debug_layer_->SetOpacity(0.5f); |
| 129 } | 129 } |
| 130 | 130 |
| 131 ToolbarLayer::~ToolbarLayer() { | 131 ToolbarLayer::~ToolbarLayer() { |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace android | 134 } // namespace android |
| 135 } // namespace chrome | 135 } // namespace chrome |
| OLD | NEW |