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

Side by Side Diff: src/gpu/GrRectanizer_skyline.h

Issue 309683002: Move GrIPoint16 to SkIPoint16 (and remove GrPoint.h) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT Created 6 years, 6 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 | « src/gpu/GrRectanizer_pow2.cpp ('k') | src/gpu/GrRectanizer_skyline.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrRectanizer_skyline_DEFINED 8 #ifndef GrRectanizer_skyline_DEFINED
9 #define GrRectanizer_skyline_DEFINED 9 #define GrRectanizer_skyline_DEFINED
10 10
(...skipping 12 matching lines...) Expand all
23 23
24 virtual void reset() SK_OVERRIDE{ 24 virtual void reset() SK_OVERRIDE{
25 fAreaSoFar = 0; 25 fAreaSoFar = 0;
26 fSkyline.reset(); 26 fSkyline.reset();
27 SkylineSegment* seg = fSkyline.append(1); 27 SkylineSegment* seg = fSkyline.append(1);
28 seg->fX = 0; 28 seg->fX = 0;
29 seg->fY = 0; 29 seg->fY = 0;
30 seg->fWidth = this->width(); 30 seg->fWidth = this->width();
31 } 31 }
32 32
33 virtual bool addRect(int w, int h, GrIPoint16* loc) SK_OVERRIDE; 33 virtual bool addRect(int w, int h, SkIPoint16* loc) SK_OVERRIDE;
34 34
35 virtual float percentFull() const SK_OVERRIDE{ 35 virtual float percentFull() const SK_OVERRIDE{
36 return fAreaSoFar / ((float)this->width() * this->height()); 36 return fAreaSoFar / ((float)this->width() * this->height());
37 } 37 }
38 38
39 private: 39 private:
40 struct SkylineSegment { 40 struct SkylineSegment {
41 int fX; 41 int fX;
42 int fY; 42 int fY;
43 int fWidth; 43 int fWidth;
44 }; 44 };
45 45
46 SkTDArray<SkylineSegment> fSkyline; 46 SkTDArray<SkylineSegment> fSkyline;
47 47
48 int32_t fAreaSoFar; 48 int32_t fAreaSoFar;
49 49
50 bool rectangleFits(int skylineIndex, int width, int height, int* y) const; 50 bool rectangleFits(int skylineIndex, int width, int height, int* y) const;
51 void addSkylineLevel(int skylineIndex, int x, int y, int width, int height); 51 void addSkylineLevel(int skylineIndex, int x, int y, int width, int height);
52 52
53 typedef GrRectanizer INHERITED; 53 typedef GrRectanizer INHERITED;
54 }; 54 };
55 55
56 #endif 56 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrRectanizer_pow2.cpp ('k') | src/gpu/GrRectanizer_skyline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698