Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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 CC_RESOURCES_PICTURE_H_ | 5 #ifndef CC_RESOURCES_PICTURE_H_ |
| 6 #define CC_RESOURCES_PICTURE_H_ | 6 #define CC_RESOURCES_PICTURE_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 13 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
| 14 #include "skia/ext/lazy_pixel_ref.h" | 15 #include "skia/ext/lazy_pixel_ref.h" |
| 15 #include "skia/ext/refptr.h" | 16 #include "skia/ext/refptr.h" |
| 16 #include "third_party/skia/include/core/SkPixelRef.h" | 17 #include "third_party/skia/include/core/SkPixelRef.h" |
| 17 #include "third_party/skia/include/core/SkTileGridPicture.h" | 18 #include "third_party/skia/include/core/SkTileGridPicture.h" |
| 18 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 // Apply this contents scale and raster the content rect into the canvas. | 53 // Apply this contents scale and raster the content rect into the canvas. |
| 53 void Raster(SkCanvas* canvas, | 54 void Raster(SkCanvas* canvas, |
| 54 gfx::Rect content_rect, | 55 gfx::Rect content_rect, |
| 55 float contents_scale, | 56 float contents_scale, |
| 56 bool enable_lcd_text); | 57 bool enable_lcd_text); |
| 57 | 58 |
| 58 void GatherPixelRefs( | 59 void GatherPixelRefs( |
| 59 const gfx::Rect& layer_rect, | 60 const gfx::Rect& layer_rect, |
| 60 std::list<skia::LazyPixelRef*>& pixel_ref_list); | 61 std::list<skia::LazyPixelRef*>& pixel_ref_list); |
| 61 | 62 |
| 63 void AsBase64String(std::string* output) const; | |
| 64 void SetPictureFromBase64String(const std::string& encoded); | |
| 62 private: | 65 private: |
|
tfarina
2013/04/13 00:49:01
nit: add a blank line above.
| |
| 63 explicit Picture(gfx::Rect layer_rect); | 66 explicit Picture(gfx::Rect layer_rect); |
| 64 // This constructor assumes SkPicture is already ref'd and transfers | 67 // This constructor assumes SkPicture is already ref'd and transfers |
| 65 // ownership to this picture. | 68 // ownership to this picture. |
| 66 Picture(const skia::RefPtr<SkPicture>&, | 69 Picture(const skia::RefPtr<SkPicture>&, |
| 67 gfx::Rect layer_rect, | 70 gfx::Rect layer_rect, |
| 68 gfx::Rect opaque_rect); | 71 gfx::Rect opaque_rect); |
| 69 ~Picture(); | 72 ~Picture(); |
| 70 | 73 |
| 71 gfx::Rect layer_rect_; | 74 gfx::Rect layer_rect_; |
| 72 gfx::Rect opaque_rect_; | 75 gfx::Rect opaque_rect_; |
| 73 skia::RefPtr<SkPicture> picture_; | 76 skia::RefPtr<SkPicture> picture_; |
| 74 | 77 |
| 75 typedef std::vector<scoped_refptr<Picture> > PictureVector; | 78 typedef std::vector<scoped_refptr<Picture> > PictureVector; |
| 76 PictureVector clones_; | 79 PictureVector clones_; |
| 77 | 80 |
| 78 friend class base::RefCountedThreadSafe<Picture>; | 81 friend class base::RefCountedThreadSafe<Picture>; |
| 79 DISALLOW_COPY_AND_ASSIGN(Picture); | 82 DISALLOW_COPY_AND_ASSIGN(Picture); |
| 80 }; | 83 }; |
| 81 | 84 |
| 82 } // namespace cc | 85 } // namespace cc |
| 83 | 86 |
| 84 #endif // CC_RESOURCES_PICTURE_H_ | 87 #endif // CC_RESOURCES_PICTURE_H_ |
| OLD | NEW |