| 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_CONTEXT_H_ | 5 #ifndef UI_COMPOSITOR_PAINT_CONTEXT_H_ |
| 6 #define UI_COMPOSITOR_PAINT_CONTEXT_H_ | 6 #define UI_COMPOSITOR_PAINT_CONTEXT_H_ |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/compositor/compositor_export.h" | 10 #include "ui/compositor/compositor_export.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // |invalidation|. | 31 // |invalidation|. |
| 32 PaintContext(gfx::Canvas* canvas, const gfx::Rect& invalidation); | 32 PaintContext(gfx::Canvas* canvas, const gfx::Rect& invalidation); |
| 33 | 33 |
| 34 // Construct a PaintContext that may only re-paint the area in the | 34 // Construct a PaintContext that may only re-paint the area in the |
| 35 // |invalidation|. | 35 // |invalidation|. |
| 36 PaintContext(cc::DisplayItemList* list, | 36 PaintContext(cc::DisplayItemList* list, |
| 37 float device_scale_factor, | 37 float device_scale_factor, |
| 38 const gfx::Rect& bounds, | 38 const gfx::Rect& bounds, |
| 39 const gfx::Rect& invalidation); | 39 const gfx::Rect& invalidation); |
| 40 | 40 |
| 41 // Construct a PaintContext that will re-paint everything (no consideration | |
| 42 // for invalidation). | |
| 43 explicit PaintContext(gfx::Canvas* canvas); | |
| 44 | |
| 45 // Clone a PaintContext with an additional |offset|. | 41 // Clone a PaintContext with an additional |offset|. |
| 46 PaintContext(const PaintContext& other, const gfx::Vector2d& offset); | 42 PaintContext(const PaintContext& other, const gfx::Vector2d& offset); |
| 47 | 43 |
| 48 // Clone a PaintContext that has no consideration for invalidation. | 44 // Clone a PaintContext that has no consideration for invalidation. |
| 49 enum CloneWithoutInvalidation { | 45 enum CloneWithoutInvalidation { |
| 50 CLONE_WITHOUT_INVALIDATION, | 46 CLONE_WITHOUT_INVALIDATION, |
| 51 }; | 47 }; |
| 52 PaintContext(const PaintContext& other, CloneWithoutInvalidation c); | 48 PaintContext(const PaintContext& other, CloneWithoutInvalidation c); |
| 53 | 49 |
| 54 ~PaintContext(); | 50 ~PaintContext(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // recorder is active. | 116 // recorder is active. |
| 121 mutable bool inside_paint_recorder_; | 117 mutable bool inside_paint_recorder_; |
| 122 #endif | 118 #endif |
| 123 | 119 |
| 124 DISALLOW_COPY_AND_ASSIGN(PaintContext); | 120 DISALLOW_COPY_AND_ASSIGN(PaintContext); |
| 125 }; | 121 }; |
| 126 | 122 |
| 127 } // namespace ui | 123 } // namespace ui |
| 128 | 124 |
| 129 #endif // UI_COMPOSITOR_PAINT_CONTEXT_H_ | 125 #endif // UI_COMPOSITOR_PAINT_CONTEXT_H_ |
| OLD | NEW |