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

Side by Side Diff: cc/playback/display_list_raster_source.h

Issue 1531013004: cc: Do solid color analysis before scheduling tiles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup. Created 4 years, 11 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_PLAYBACK_DISPLAY_LIST_RASTER_SOURCE_H_ 5 #ifndef CC_PLAYBACK_DISPLAY_LIST_RASTER_SOURCE_H_
6 #define CC_PLAYBACK_DISPLAY_LIST_RASTER_SOURCE_H_ 6 #define CC_PLAYBACK_DISPLAY_LIST_RASTER_SOURCE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "cc/base/cc_export.h" 11 #include "cc/base/cc_export.h"
12 #include "cc/debug/rendering_stats_instrumentation.h" 12 #include "cc/debug/rendering_stats_instrumentation.h"
13 #include "cc/playback/display_list_recording_source.h" 13 #include "cc/playback/display_list_recording_source.h"
14 #include "skia/ext/analysis_canvas.h" 14 #include "skia/ext/analysis_canvas.h"
15 #include "skia/ext/refptr.h" 15 #include "skia/ext/refptr.h"
16 #include "third_party/skia/include/core/SkPicture.h" 16 #include "third_party/skia/include/core/SkPicture.h"
17 17
18 namespace cc { 18 namespace cc {
19 class DisplayItemList; 19 class DisplayItemList;
20 class DrawImage; 20 class DrawImage;
21 21
22 class CC_EXPORT DisplayListRasterSource 22 class CC_EXPORT DisplayListRasterSource
23 : public base::RefCountedThreadSafe<DisplayListRasterSource> { 23 : public base::RefCountedThreadSafe<DisplayListRasterSource> {
24 public: 24 public:
25 struct CC_EXPORT SolidColorAnalysis { 25 struct CC_EXPORT SolidColorAnalysis {
vmpstr 2015/12/29 21:24:23 This can go away too right?
sohanjg 2015/12/30 12:45:47 Done.
26 SolidColorAnalysis() 26 SolidColorAnalysis()
27 : is_solid_color(false), solid_color(SK_ColorTRANSPARENT) {} 27 : is_solid_color(false), solid_color(SK_ColorTRANSPARENT) {}
28 ~SolidColorAnalysis() {} 28 ~SolidColorAnalysis() {}
29 29
30 bool is_solid_color; 30 bool is_solid_color;
31 SkColor solid_color; 31 SkColor solid_color;
32 }; 32 };
33 33
34 static scoped_refptr<DisplayListRasterSource> 34 static scoped_refptr<DisplayListRasterSource>
35 CreateFromDisplayListRecordingSource(const DisplayListRecordingSource* other, 35 CreateFromDisplayListRecordingSource(const DisplayListRecordingSource* other,
(...skipping 13 matching lines...) Expand all
49 49
50 // Similar to above, except that the canvas passed here can (or was already) 50 // Similar to above, except that the canvas passed here can (or was already)
51 // rasterized into by another raster source. That is, it is not safe to clear 51 // rasterized into by another raster source. That is, it is not safe to clear
52 // the canvas or discard its underlying memory. 52 // the canvas or discard its underlying memory.
53 void PlaybackToSharedCanvas(SkCanvas* canvas, 53 void PlaybackToSharedCanvas(SkCanvas* canvas,
54 const gfx::Rect& canvas_rect, 54 const gfx::Rect& canvas_rect,
55 float contents_scale) const; 55 float contents_scale) const;
56 56
57 // Analyze to determine if the given rect at given scale is of solid color in 57 // Analyze to determine if the given rect at given scale is of solid color in
58 // this raster source. 58 // this raster source.
59 void PerformSolidColorAnalysis(const gfx::Rect& content_rect, 59 bool PerformSolidColorAnalysis(const gfx::Rect& content_rect,
60 float contents_scale, 60 float contents_scale,
61 SolidColorAnalysis* analysis) const; 61 SkColor* color) const;
62 62
63 // Returns true iff the whole raster source is of solid color. 63 // Returns true iff the whole raster source is of solid color.
64 bool IsSolidColor() const; 64 bool IsSolidColor() const;
65 65
66 // Returns the color of the raster source if it is solid color. The results 66 // Returns the color of the raster source if it is solid color. The results
67 // are unspecified if IsSolidColor returns false. 67 // are unspecified if IsSolidColor returns false.
68 SkColor GetSolidColor() const; 68 SkColor GetSolidColor() const;
69 69
70 // Returns the size of this raster source. 70 // Returns the size of this raster source.
71 gfx::Size GetSize() const; 71 gfx::Size GetSize() const;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 const gfx::Rect& canvas_bitmap_rect, 149 const gfx::Rect& canvas_bitmap_rect,
150 const gfx::Rect& canvas_playback_rect, 150 const gfx::Rect& canvas_playback_rect,
151 float contents_scale) const; 151 float contents_scale) const;
152 152
153 DISALLOW_COPY_AND_ASSIGN(DisplayListRasterSource); 153 DISALLOW_COPY_AND_ASSIGN(DisplayListRasterSource);
154 }; 154 };
155 155
156 } // namespace cc 156 } // namespace cc
157 157
158 #endif // CC_PLAYBACK_DISPLAY_LIST_RASTER_SOURCE_H_ 158 #endif // CC_PLAYBACK_DISPLAY_LIST_RASTER_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698