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

Side by Side Diff: src/gpu/GrRectanizer.cpp

Issue 23566022: move GrMalloc, GrFree, Gr_bzero to their sk equivalents (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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
« no previous file with comments | « src/gpu/GrPlotMgr.h ('k') | src/gpu/GrRectanizer_fifo.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 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 10
11 #include "GrRectanizer.h" 11 #include "GrRectanizer.h"
12 #include "GrTBSearch.h" 12 #include "GrTBSearch.h"
13 13
14 #define MIN_HEIGHT_POW2 2 14 #define MIN_HEIGHT_POW2 2
15 15
16 class GrRectanizerPow2 : public GrRectanizer { 16 class GrRectanizerPow2 : public GrRectanizer {
17 public: 17 public:
18 GrRectanizerPow2(int w, int h) : GrRectanizer(w, h) { 18 GrRectanizerPow2(int w, int h) : GrRectanizer(w, h) {
19 fNextStripY = 0; 19 fNextStripY = 0;
20 fAreaSoFar = 0; 20 fAreaSoFar = 0;
21 Gr_bzero(fRows, sizeof(fRows)); 21 sk_bzero(fRows, sizeof(fRows));
22 } 22 }
23 23
24 virtual ~GrRectanizerPow2() { 24 virtual ~GrRectanizerPow2() {
25 } 25 }
26 26
27 virtual bool addRect(int w, int h, GrIPoint16* loc); 27 virtual bool addRect(int w, int h, GrIPoint16* loc);
28 28
29 virtual float percentFull() const { 29 virtual float percentFull() const {
30 return fAreaSoFar / ((float)this->width() * this->height()); 30 return fAreaSoFar / ((float)this->width() * this->height());
31 } 31 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 SkASSERT(fNextStripY <= this->height()); 112 SkASSERT(fNextStripY <= this->height());
113 fAreaSoFar += area; 113 fAreaSoFar += area;
114 return true; 114 return true;
115 } 115 }
116 116
117 /////////////////////////////////////////////////////////////////////////////// 117 ///////////////////////////////////////////////////////////////////////////////
118 118
119 GrRectanizer* GrRectanizer::Factory(int width, int height) { 119 GrRectanizer* GrRectanizer::Factory(int width, int height) {
120 return SkNEW_ARGS(GrRectanizerPow2, (width, height)); 120 return SkNEW_ARGS(GrRectanizerPow2, (width, height));
121 } 121 }
OLDNEW
« no previous file with comments | « src/gpu/GrPlotMgr.h ('k') | src/gpu/GrRectanizer_fifo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698