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

Side by Side Diff: src/record/SkRecorder.cpp

Issue 248083002: Make drawText calls non-virtual, to ease SkFont and TextBlob (https://codereview.chromium.org/24385… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 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/record/SkRecorder.h ('k') | src/utils/SkDeferredCanvas.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 #include "SkRecorder.h" 8 #include "SkRecorder.h"
9 #include "SkPicture.h" 9 #include "SkPicture.h"
10 10
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 const SkIRect& center, 138 const SkIRect& center,
139 const SkRect& dst, 139 const SkRect& dst,
140 const SkPaint* paint) { 140 const SkPaint* paint) {
141 APPEND(DrawBitmapNine, delay_copy(bitmap), center, dst, this->copy(paint)); 141 APPEND(DrawBitmapNine, delay_copy(bitmap), center, dst, this->copy(paint));
142 } 142 }
143 143
144 void SkRecorder::drawSprite(const SkBitmap& bitmap, int left, int top, const SkP aint* paint) { 144 void SkRecorder::drawSprite(const SkBitmap& bitmap, int left, int top, const SkP aint* paint) {
145 APPEND(DrawSprite, delay_copy(bitmap), left, top, this->copy(paint)); 145 APPEND(DrawSprite, delay_copy(bitmap), left, top, this->copy(paint));
146 } 146 }
147 147
148 void SkRecorder::drawText(const void* text, size_t byteLength, 148 void SkRecorder::onDrawText(const void* text, size_t byteLength,
149 SkScalar x, SkScalar y, const SkPaint& paint) { 149 SkScalar x, SkScalar y, const SkPaint& paint) {
150 APPEND(DrawText, 150 APPEND(DrawText,
151 this->copy((const char*)text, byteLength), byteLength, x, y, delay_co py(paint)); 151 this->copy((const char*)text, byteLength), byteLength, x, y, delay_co py(paint));
152 } 152 }
153 153
154 void SkRecorder::drawPosText(const void* text, size_t byteLength, 154 void SkRecorder::onDrawPosText(const void* text, size_t byteLength,
155 const SkPoint pos[], const SkPaint& paint) { 155 const SkPoint pos[], const SkPaint& paint) {
156 const unsigned points = paint.countText(text, byteLength); 156 const unsigned points = paint.countText(text, byteLength);
157 APPEND(DrawPosText, 157 APPEND(DrawPosText,
158 this->copy((const char*)text, byteLength), byteLength, 158 this->copy((const char*)text, byteLength), byteLength,
159 this->copy(pos, points), delay_copy(paint)); 159 this->copy(pos, points), delay_copy(paint));
160 } 160 }
161 161
162 void SkRecorder::drawPosTextH(const void* text, size_t byteLength, 162 void SkRecorder::onDrawPosTextH(const void* text, size_t byteLength,
163 const SkScalar xpos[], SkScalar constY, const SkPa int& paint) { 163 const SkScalar xpos[], SkScalar constY, const Sk Paint& paint) {
164 const unsigned points = paint.countText(text, byteLength); 164 const unsigned points = paint.countText(text, byteLength);
165 APPEND(DrawPosTextH, 165 APPEND(DrawPosTextH,
166 this->copy((const char*)text, byteLength), byteLength, 166 this->copy((const char*)text, byteLength), byteLength,
167 this->copy(xpos, points), constY, delay_copy(paint)); 167 this->copy(xpos, points), constY, delay_copy(paint));
168 } 168 }
169 169
170 void SkRecorder::drawTextOnPath(const void* text, size_t byteLength, 170 void SkRecorder::onDrawTextOnPath(const void* text, size_t byteLength, const SkP ath& path,
171 const SkPath& path, const SkMatrix* matrix, cons t SkPaint& paint) { 171 const SkMatrix* matrix, const SkPaint& paint) {
172 APPEND(DrawTextOnPath, 172 APPEND(DrawTextOnPath,
173 this->copy((const char*)text, byteLength), byteLength, 173 this->copy((const char*)text, byteLength), byteLength,
174 delay_copy(path), this->copy(matrix), delay_copy(paint)); 174 delay_copy(path), this->copy(matrix), delay_copy(paint));
175 } 175 }
176 176
177 void SkRecorder::drawPicture(SkPicture& picture) { 177 void SkRecorder::drawPicture(SkPicture& picture) {
178 picture.draw(this); 178 picture.draw(this);
179 } 179 }
180 180
181 void SkRecorder::drawVertices(VertexMode vmode, 181 void SkRecorder::drawVertices(VertexMode vmode,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 242
243 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e dgeStyle) { 243 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e dgeStyle) {
244 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle); 244 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle);
245 INHERITED(updateClipConservativelyUsingBounds, path.getBounds(), op, path.is InverseFillType()); 245 INHERITED(updateClipConservativelyUsingBounds, path.getBounds(), op, path.is InverseFillType());
246 } 246 }
247 247
248 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { 248 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
249 APPEND(ClipRegion, delay_copy(deviceRgn), op); 249 APPEND(ClipRegion, delay_copy(deviceRgn), op);
250 INHERITED(onClipRegion, deviceRgn, op); 250 INHERITED(onClipRegion, deviceRgn, op);
251 } 251 }
OLDNEW
« no previous file with comments | « src/record/SkRecorder.h ('k') | src/utils/SkDeferredCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698