Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Side by Side Diff: cc/resources/picture.h

Issue 13884018: cc: Add base64 encoding to picture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 1.0 -> 1.0f Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/resources/picture.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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);
nduca 2013/04/18 19:43:48 Does this include set layer_rect and opaque_rect?
65
62 private: 66 private:
63 explicit Picture(gfx::Rect layer_rect); 67 explicit Picture(gfx::Rect layer_rect);
64 // This constructor assumes SkPicture is already ref'd and transfers 68 // This constructor assumes SkPicture is already ref'd and transfers
65 // ownership to this picture. 69 // ownership to this picture.
66 Picture(const skia::RefPtr<SkPicture>&, 70 Picture(const skia::RefPtr<SkPicture>&,
67 gfx::Rect layer_rect, 71 gfx::Rect layer_rect,
68 gfx::Rect opaque_rect); 72 gfx::Rect opaque_rect);
69 ~Picture(); 73 ~Picture();
70 74
71 gfx::Rect layer_rect_; 75 gfx::Rect layer_rect_;
72 gfx::Rect opaque_rect_; 76 gfx::Rect opaque_rect_;
73 skia::RefPtr<SkPicture> picture_; 77 skia::RefPtr<SkPicture> picture_;
74 78
75 typedef std::vector<scoped_refptr<Picture> > PictureVector; 79 typedef std::vector<scoped_refptr<Picture> > PictureVector;
76 PictureVector clones_; 80 PictureVector clones_;
77 81
78 friend class base::RefCountedThreadSafe<Picture>; 82 friend class base::RefCountedThreadSafe<Picture>;
79 DISALLOW_COPY_AND_ASSIGN(Picture); 83 DISALLOW_COPY_AND_ASSIGN(Picture);
80 }; 84 };
81 85
82 } // namespace cc 86 } // namespace cc
83 87
84 #endif // CC_RESOURCES_PICTURE_H_ 88 #endif // CC_RESOURCES_PICTURE_H_
OLDNEW
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/resources/picture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698