| 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 UI_COMPOSITOR_PAINT_CACHE_H_ | 5 #ifndef UI_COMPOSITOR_PAINT_CACHE_H_ |
| 6 #define UI_COMPOSITOR_PAINT_CACHE_H_ | 6 #define UI_COMPOSITOR_PAINT_CACHE_H_ |
| 7 | 7 |
| 8 #include "cc/playback/drawing_display_item.h" | 8 #include "cc/playback/drawing_display_item.h" |
| 9 #include "ui/compositor/compositor_export.h" | 9 #include "ui/compositor/compositor_export.h" |
| 10 #include "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // Returns true if the PaintCache was able to insert a previously-saved | 23 // Returns true if the PaintCache was able to insert a previously-saved |
| 24 // painting output into the PaintContext. If it returns false, the caller | 24 // painting output into the PaintContext. If it returns false, the caller |
| 25 // needs to do the work of painting, which can be stored into the PaintCache | 25 // needs to do the work of painting, which can be stored into the PaintCache |
| 26 // to be used next time. | 26 // to be used next time. |
| 27 bool UseCache(const PaintContext& context, const gfx::Size& size_in_context); | 27 bool UseCache(const PaintContext& context, const gfx::Size& size_in_context); |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 // Only PaintRecorder can modify these. | 30 // Only PaintRecorder can modify these. |
| 31 friend PaintRecorder; | 31 friend PaintRecorder; |
| 32 | 32 |
| 33 void SetCache(const cc::DrawingDisplayItem& item); | 33 void SetCache(const cc::DrawingDisplayItem* item); |
| 34 | 34 |
| 35 bool has_cache_; | 35 bool has_cache_; |
| 36 cc::DrawingDisplayItem display_item_; | 36 cc::DrawingDisplayItem display_item_; |
| 37 | 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(PaintCache); | 38 DISALLOW_COPY_AND_ASSIGN(PaintCache); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 } // namespace ui | 41 } // namespace ui |
| 42 | 42 |
| 43 #endif // UI_COMPOSITOR_PAINT_CACHE_H_ | 43 #endif // UI_COMPOSITOR_PAINT_CACHE_H_ |
| OLD | NEW |