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

Side by Side Diff: src/pipe/SkGPipeWrite.cpp

Issue 13957009: First pass at Comment API (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Addressed code review issues Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkPictureRecord.cpp ('k') | src/utils/SkDumpCanvas.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 2011 Google Inc. 3 * Copyright 2011 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 #include "SkAnnotation.h" 9 #include "SkAnnotation.h"
10 #include "SkBitmapHeap.h" 10 #include "SkBitmapHeap.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 virtual void drawTextOnPath(const void* text, size_t byteLength, 248 virtual void drawTextOnPath(const void* text, size_t byteLength,
249 const SkPath& path, const SkMatrix* matrix, 249 const SkPath& path, const SkMatrix* matrix,
250 const SkPaint&) SK_OVERRIDE; 250 const SkPaint&) SK_OVERRIDE;
251 virtual void drawPicture(SkPicture& picture) SK_OVERRIDE; 251 virtual void drawPicture(SkPicture& picture) SK_OVERRIDE;
252 virtual void drawVertices(VertexMode, int vertexCount, 252 virtual void drawVertices(VertexMode, int vertexCount,
253 const SkPoint vertices[], const SkPoint texs[], 253 const SkPoint vertices[], const SkPoint texs[],
254 const SkColor colors[], SkXfermode*, 254 const SkColor colors[], SkXfermode*,
255 const uint16_t indices[], int indexCount, 255 const uint16_t indices[], int indexCount,
256 const SkPaint&) SK_OVERRIDE; 256 const SkPaint&) SK_OVERRIDE;
257 virtual void drawData(const void*, size_t) SK_OVERRIDE; 257 virtual void drawData(const void*, size_t) SK_OVERRIDE;
258 virtual void beginCommentGroup(const char* description) SK_OVERRIDE;
259 virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE;
260 virtual void endCommentGroup() SK_OVERRIDE;
258 261
259 /** 262 /**
260 * Flatten an SkBitmap to send to the reader, where it will be referenced 263 * Flatten an SkBitmap to send to the reader, where it will be referenced
261 * according to slot. 264 * according to slot.
262 */ 265 */
263 bool shuttleBitmap(const SkBitmap&, int32_t slot); 266 bool shuttleBitmap(const SkBitmap&, int32_t slot);
264 private: 267 private:
265 enum { 268 enum {
266 kNoSaveLayer = -1, 269 kNoSaveLayer = -1,
267 }; 270 };
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 if (this->needOpBytes(4 + SkAlign4(size))) { 966 if (this->needOpBytes(4 + SkAlign4(size))) {
964 this->writeOp(kDrawData_DrawOp, 0, data); 967 this->writeOp(kDrawData_DrawOp, 0, data);
965 if (0 == data) { 968 if (0 == data) {
966 fWriter.write32(size); 969 fWriter.write32(size);
967 } 970 }
968 fWriter.writePad(ptr, size); 971 fWriter.writePad(ptr, size);
969 } 972 }
970 } 973 }
971 } 974 }
972 975
976 void SkGPipeCanvas::beginCommentGroup(const char* description) {
977 // ignore for now
978 }
979
980 void SkGPipeCanvas::addComment(const char* kywd, const char* value) {
981 // ignore for now
982 }
983
984 void SkGPipeCanvas::endCommentGroup() {
985 // ignore for now
986 }
987
973 void SkGPipeCanvas::flushRecording(bool detachCurrentBlock) { 988 void SkGPipeCanvas::flushRecording(bool detachCurrentBlock) {
974 doNotify(); 989 doNotify();
975 if (detachCurrentBlock) { 990 if (detachCurrentBlock) {
976 // force a new block to be requested for the next recorded command 991 // force a new block to be requested for the next recorded command
977 fBlockSize = 0; 992 fBlockSize = 0;
978 } 993 }
979 } 994 }
980 995
981 size_t SkGPipeCanvas::freeMemoryIfPossible(size_t bytesToFree) { 996 size_t SkGPipeCanvas::freeMemoryIfPossible(size_t bytesToFree) {
982 return (NULL == fBitmapHeap) ? 0 : fBitmapHeap->freeMemoryIfPossible(bytesTo Free); 997 return (NULL == fBitmapHeap) ? 0 : fBitmapHeap->freeMemoryIfPossible(bytesTo Free);
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 fCanvas->ref(); 1186 fCanvas->ref();
1172 } 1187 }
1173 1188
1174 BitmapShuttle::~BitmapShuttle() { 1189 BitmapShuttle::~BitmapShuttle() {
1175 fCanvas->unref(); 1190 fCanvas->unref();
1176 } 1191 }
1177 1192
1178 bool BitmapShuttle::insert(const SkBitmap& bitmap, int32_t slot) { 1193 bool BitmapShuttle::insert(const SkBitmap& bitmap, int32_t slot) {
1179 return fCanvas->shuttleBitmap(bitmap, slot); 1194 return fCanvas->shuttleBitmap(bitmap, slot);
1180 } 1195 }
OLDNEW
« no previous file with comments | « src/core/SkPictureRecord.cpp ('k') | src/utils/SkDumpCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698