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

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

Issue 494503002: Expose IsSolidColor and write units tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Vmpstr's issues Created 6 years, 4 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 | « no previous file | cc/resources/picture.cc » ('j') | cc/resources/picture.cc » ('J')
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 <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 gfx::Rect LayerRect() const { return layer_rect_; } 67 gfx::Rect LayerRect() const { return layer_rect_; }
68 gfx::Rect OpaqueRect() const { return opaque_rect_; } 68 gfx::Rect OpaqueRect() const { return opaque_rect_; }
69 69
70 // Get thread-safe clone for rasterizing with on a specific thread. 70 // Get thread-safe clone for rasterizing with on a specific thread.
71 Picture* GetCloneForDrawingOnThread(unsigned thread_index); 71 Picture* GetCloneForDrawingOnThread(unsigned thread_index);
72 72
73 // Has Record() been called yet? 73 // Has Record() been called yet?
74 bool HasRecording() const { return picture_.get() != NULL; } 74 bool HasRecording() const { return picture_.get() != NULL; }
75 75
76 bool IsSuitableForGpuRasterization() const; 76 bool IsSuitableForGpuRasterization() const;
77 int GetApproximateOpCount() const;
enne (OOO) 2014/08/20 18:19:26 style nit: No need for "get" in a function name.
hendrikw 2014/08/20 20:46:55 vmpstr suggested the name :) I think Get improves
77 78
78 // Apply this scale and raster the negated region into the canvas. 79 // Apply this scale and raster the negated region into the canvas.
79 // |negated_content_region| specifies the region to be clipped out of the 80 // |negated_content_region| specifies the region to be clipped out of the
80 // raster operation, i.e., the parts of the canvas which will not get drawn 81 // raster operation, i.e., the parts of the canvas which will not get drawn
81 // to. 82 // to.
82 int Raster(SkCanvas* canvas, 83 int Raster(SkCanvas* canvas,
83 SkDrawPictureCallback* callback, 84 SkDrawPictureCallback* callback,
84 const Region& negated_content_region, 85 const Region& negated_content_region,
85 float contents_scale); 86 float contents_scale);
86 87
88 void RasterForAnalysis(SkCanvas* canvas);
89
87 // Draw the picture directly into the given canvas, without applying any 90 // Draw the picture directly into the given canvas, without applying any
88 // clip/scale/layer transformations. 91 // clip/scale/layer transformations.
89 void Replay(SkCanvas* canvas); 92 void Replay(SkCanvas* canvas);
90 93
91 scoped_ptr<base::Value> AsValue() const; 94 scoped_ptr<base::Value> AsValue() const;
92 95
93 // This iterator imprecisely returns the set of pixel refs that are needed to 96 // This iterator imprecisely returns the set of pixel refs that are needed to
94 // raster this layer rect from this picture. Internally, pixel refs are 97 // raster this layer rect from this picture. Internally, pixel refs are
95 // clumped into tile grid buckets, so there may be false positives. 98 // clumped into tile grid buckets, so there may be false positives.
96 class CC_EXPORT PixelRefIterator { 99 class CC_EXPORT PixelRefIterator {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 base::ThreadChecker raster_thread_checker_; 181 base::ThreadChecker raster_thread_checker_;
179 182
180 friend class base::RefCountedThreadSafe<Picture>; 183 friend class base::RefCountedThreadSafe<Picture>;
181 friend class PixelRefIterator; 184 friend class PixelRefIterator;
182 DISALLOW_COPY_AND_ASSIGN(Picture); 185 DISALLOW_COPY_AND_ASSIGN(Picture);
183 }; 186 };
184 187
185 } // namespace cc 188 } // namespace cc
186 189
187 #endif // CC_RESOURCES_PICTURE_H_ 190 #endif // CC_RESOURCES_PICTURE_H_
OLDNEW
« no previous file with comments | « no previous file | cc/resources/picture.cc » ('j') | cc/resources/picture.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698