| 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 #ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_CRUSHED_SPRITE_LAYER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_CRUSHED_SPRITE_LAYER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_CRUSHED_SPRITE_LAYER_H_ | 6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_CRUSHED_SPRITE_LAYER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/android/compositor/layer/layer.h" | 9 #include "chrome/browser/android/compositor/layer/layer.h" |
| 10 #include "third_party/skia/include/core/SkBitmap.h" |
| 11 #include "third_party/skia/include/core/SkRefCnt.h" |
| 12 |
| 13 class SkCanvas; |
| 10 | 14 |
| 11 namespace cc { | 15 namespace cc { |
| 12 class UIResourceLayer; | 16 class UIResourceLayer; |
| 13 } | 17 } |
| 14 | 18 |
| 15 namespace ui { | 19 namespace ui { |
| 16 class CrushedSpriteResource; | 20 class CrushedSpriteResource; |
| 17 class ResourceManager; | 21 class ResourceManager; |
| 18 } | 22 } |
| 19 | 23 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 39 scoped_refptr<cc::Layer> layer() override; | 43 scoped_refptr<cc::Layer> layer() override; |
| 40 | 44 |
| 41 protected: | 45 protected: |
| 42 CrushedSpriteLayer(); | 46 CrushedSpriteLayer(); |
| 43 ~CrushedSpriteLayer() override; | 47 ~CrushedSpriteLayer() override; |
| 44 | 48 |
| 45 private: | 49 private: |
| 46 // Draws the rectangles for |frame| to |canvas|. | 50 // Draws the rectangles for |frame| to |canvas|. |
| 47 void DrawRectanglesForFrame(ui::CrushedSpriteResource* resource, | 51 void DrawRectanglesForFrame(ui::CrushedSpriteResource* resource, |
| 48 int frame, | 52 int frame, |
| 49 skia::RefPtr<SkCanvas> canvas); | 53 sk_sp<SkCanvas> canvas); |
| 50 | 54 |
| 51 scoped_refptr<cc::UIResourceLayer> layer_; | 55 scoped_refptr<cc::UIResourceLayer> layer_; |
| 52 int frame_count_; | 56 int frame_count_; |
| 53 int previous_frame_; | 57 int previous_frame_; |
| 54 SkBitmap previous_frame_bitmap_; | 58 SkBitmap previous_frame_bitmap_; |
| 55 | 59 |
| 56 DISALLOW_COPY_AND_ASSIGN(CrushedSpriteLayer); | 60 DISALLOW_COPY_AND_ASSIGN(CrushedSpriteLayer); |
| 57 }; | 61 }; |
| 58 | 62 |
| 59 } // namespace android | 63 } // namespace android |
| 60 } // namespace chrome | 64 } // namespace chrome |
| 61 | 65 |
| 62 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_CRUSHED_SPRITE_LAYER_H_ | 66 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_CRUSHED_SPRITE_LAYER_H_ |
| OLD | NEW |