OLD | NEW |
(Empty) | |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_PICTURE_PILE_H_ |
| 6 #define CC_PICTURE_PILE_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "cc/cc_export.h" |
| 10 #include "cc/picture.h" |
| 11 #include "cc/scoped_ptr_vector.h" |
| 12 #include "ui/gfx/rect.h" |
| 13 #include "ui/gfx/size.h" |
| 14 |
| 15 namespace cc { |
| 16 |
| 17 class CC_EXPORT PicturePile { |
| 18 public: |
| 19 PicturePile(); |
| 20 ~PicturePile(); |
| 21 |
| 22 // Mark a portion of the PicturePile as invalid and needing to be re-recorded |
| 23 // the next time update is called. |
| 24 void invalidate(gfx::Rect); |
| 25 |
| 26 // Resize the PicturePile, invalidating / dropping recorded pictures as necess
ary. |
| 27 void resize(gfx::Size); |
| 28 |
| 29 // Rerecord parts of the picture that are invalid. |
| 30 void update(ContentLayerClient* painter); |
| 31 |
| 32 // Update other with a shallow copy of this (main => compositor thread commit) |
| 33 void pushPropertiesTo(PicturePile& other); |
| 34 |
| 35 // Clone a paint-safe version of this picture (with cloned PicturePileRecords) |
| 36 scoped_ptr<PicturePile> cloneForDrawing(gfx::Rect rect); |
| 37 |
| 38 // Raster a subrect of this PicturePile into the given canvas. |
| 39 // It's only safe to call paint on a cloned version. |
| 40 void paint(SkCanvas* canvas, gfx::Rect rect); |
| 41 |
| 42 protected: |
| 43 std::vector<scoped_refptr<Picture> > pile_; |
| 44 gfx::Size size_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(PicturePile); |
| 47 }; |
| 48 |
| 49 } // namespace cc |
| 50 |
| 51 #endif // CC_PICTURE_PILE_H_ |
OLD | NEW |