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

Side by Side Diff: cc/picture.h

Issue 12194015: cc: Rasterize cheap tiles immediately (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Trace event for cheap rasters that weren't. Created 7 years, 10 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 | Annotate | Revision Log
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_PICTURE_H_ 5 #ifndef CC_PICTURE_H_
6 #define CC_PICTURE_H_ 6 #define CC_PICTURE_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 24 matching lines...) Expand all
35 // Record a paint operation. To be able to safely use this SkPicture for 35 // Record a paint operation. To be able to safely use this SkPicture for
36 // playback on a different thread this can only be called once. 36 // playback on a different thread this can only be called once.
37 void Record(ContentLayerClient*, RenderingStats*); 37 void Record(ContentLayerClient*, RenderingStats*);
38 38
39 // Has Record() been called yet? 39 // Has Record() been called yet?
40 bool HasRecording() const { return picture_.get() != NULL; } 40 bool HasRecording() const { return picture_.get() != NULL; }
41 41
42 // Apply this contents scale and raster the content rect into the canvas. 42 // Apply this contents scale and raster the content rect into the canvas.
43 void Raster(SkCanvas* canvas, gfx::Rect content_rect, float contents_scale); 43 void Raster(SkCanvas* canvas, gfx::Rect content_rect, float contents_scale);
44 44
45 bool IsCheapInRect(const gfx::Rect& layer_rect); 45 bool IsCheapInRect(const gfx::Rect& layer_rect) const;
46 46
47 void GatherPixelRefs( 47 void GatherPixelRefs(
48 const gfx::Rect& layer_rect, 48 const gfx::Rect& layer_rect,
49 std::list<skia::LazyPixelRef*>& pixel_ref_list); 49 std::list<skia::LazyPixelRef*>& pixel_ref_list);
50 50
51 private: 51 private:
52 Picture(gfx::Rect layer_rect); 52 Picture(gfx::Rect layer_rect);
53 // This constructor assumes SkPicture is already ref'd and transfers 53 // This constructor assumes SkPicture is already ref'd and transfers
54 // ownership to this picture. 54 // ownership to this picture.
55 Picture(const skia::RefPtr<SkPicture>&, 55 Picture(const skia::RefPtr<SkPicture>&,
56 gfx::Rect layer_rect, 56 gfx::Rect layer_rect,
57 gfx::Rect opaque_rect); 57 gfx::Rect opaque_rect);
58 ~Picture(); 58 ~Picture();
59 59
60 gfx::Rect layer_rect_; 60 gfx::Rect layer_rect_;
61 gfx::Rect opaque_rect_; 61 gfx::Rect opaque_rect_;
62 skia::RefPtr<SkPicture> picture_; 62 skia::RefPtr<SkPicture> picture_;
63 63
64 friend class base::RefCountedThreadSafe<Picture>; 64 friend class base::RefCountedThreadSafe<Picture>;
65 DISALLOW_COPY_AND_ASSIGN(Picture); 65 DISALLOW_COPY_AND_ASSIGN(Picture);
66 }; 66 };
67 67
68 } // namespace cc 68 } // namespace cc
69 69
70 #endif // CC_PICTURE_H_ 70 #endif // CC_PICTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698