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

Side by Side Diff: src/core/SkPicture.cpp

Issue 12545009: Adding option in SkPicture to record device-space bounds of draw commands. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2007 The Android Open Source Project 3 * Copyright 2007 The Android Open Source Project
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 #include "SkPictureFlat.h" 10 #include "SkPictureFlat.h"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 info.fVersion = PICTURE_VERSION; 313 info.fVersion = PICTURE_VERSION;
314 info.fWidth = fWidth; 314 info.fWidth = fWidth;
315 info.fHeight = fHeight; 315 info.fHeight = fHeight;
316 info.fFlags = SkPictInfo::kCrossProcess_Flag; 316 info.fFlags = SkPictInfo::kCrossProcess_Flag;
317 #ifdef SK_SCALAR_IS_FLOAT 317 #ifdef SK_SCALAR_IS_FLOAT
318 info.fFlags |= SkPictInfo::kScalarIsFloat_Flag; 318 info.fFlags |= SkPictInfo::kScalarIsFloat_Flag;
319 #endif 319 #endif
320 if (8 == sizeof(void*)) { 320 if (8 == sizeof(void*)) {
321 info.fFlags |= SkPictInfo::kPtrIs64Bit_Flag; 321 info.fFlags |= SkPictInfo::kPtrIs64Bit_Flag;
322 } 322 }
323 if (NULL != playback && playback->hasRecordedBounds()) {
324 info.fFlags |= SkPictInfo::kHasRecordedBounds_Flag;
325 }
323 326
324 stream->write(&info, sizeof(info)); 327 stream->write(&info, sizeof(info));
325 if (playback) { 328 if (playback) {
326 stream->writeBool(true); 329 stream->writeBool(true);
327 playback->serialize(stream, encoder); 330 playback->serialize(stream, encoder);
328 // delete playback if it is a local version (i.e. cons'd up just now) 331 // delete playback if it is a local version (i.e. cons'd up just now)
329 if (playback != fPlayback) { 332 if (playback != fPlayback) {
330 SkDELETE(playback); 333 SkDELETE(playback);
331 } 334 }
332 } else { 335 } else {
333 stream->writeBool(false); 336 stream->writeBool(false);
334 } 337 }
335 } 338 }
336 339
337 #ifdef SK_BUILD_FOR_ANDROID 340 #ifdef SK_BUILD_FOR_ANDROID
338 void SkPicture::abortPlayback() { 341 void SkPicture::abortPlayback() {
339 if (NULL == fPlayback) { 342 if (NULL == fPlayback) {
340 return; 343 return;
341 } 344 }
342 fPlayback->abort(); 345 fPlayback->abort();
343 } 346 }
344 #endif 347 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698