OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/crushed_sprite_layer.h" | 5 #include "chrome/browser/android/compositor/layer/crushed_sprite_layer.h" |
6 | 6 |
7 #include "cc/layers/layer.h" | 7 #include "cc/layers/layer.h" |
8 #include "cc/layers/layer_settings.h" | |
9 #include "cc/layers/ui_resource_layer.h" | 8 #include "cc/layers/ui_resource_layer.h" |
10 #include "content/public/browser/android/compositor.h" | 9 #include "content/public/browser/android/compositor.h" |
11 #include "ui/android/resources/crushed_sprite_resource.h" | 10 #include "ui/android/resources/crushed_sprite_resource.h" |
12 #include "ui/android/resources/resource_manager.h" | 11 #include "ui/android/resources/resource_manager.h" |
13 #include "ui/gfx/canvas.h" | 12 #include "ui/gfx/canvas.h" |
14 #include "ui/gfx/skia_util.h" | 13 #include "ui/gfx/skia_util.h" |
15 | 14 |
16 namespace chrome { | 15 namespace chrome { |
17 namespace android { | 16 namespace android { |
18 | 17 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 resource->GetRectanglesForFrame(frame); | 108 resource->GetRectanglesForFrame(frame); |
110 for (const auto& rect : src_dst_rects) { | 109 for (const auto& rect : src_dst_rects) { |
111 canvas->drawBitmapRect(resource->GetBitmap(), | 110 canvas->drawBitmapRect(resource->GetBitmap(), |
112 gfx::RectToSkRect(rect.first), | 111 gfx::RectToSkRect(rect.first), |
113 gfx::RectToSkRect(rect.second), | 112 gfx::RectToSkRect(rect.second), |
114 nullptr); | 113 nullptr); |
115 } | 114 } |
116 } | 115 } |
117 | 116 |
118 CrushedSpriteLayer::CrushedSpriteLayer() | 117 CrushedSpriteLayer::CrushedSpriteLayer() |
119 : layer_( | 118 : layer_(cc::UIResourceLayer::Create()), |
120 cc::UIResourceLayer::Create(cc::LayerSettings())), | |
121 frame_count_(-1), | 119 frame_count_(-1), |
122 previous_frame_(-1) { | 120 previous_frame_(-1) { |
123 layer_->SetIsDrawable(true); | 121 layer_->SetIsDrawable(true); |
124 } | 122 } |
125 | 123 |
126 | 124 |
127 CrushedSpriteLayer::~CrushedSpriteLayer() { | 125 CrushedSpriteLayer::~CrushedSpriteLayer() { |
128 } | 126 } |
129 | 127 |
130 } // namespace android | 128 } // namespace android |
131 } // namespace chrome | 129 } // namespace chrome |
OLD | NEW |