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

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

Issue 464433002: Add layer counting to SkPictureRecord (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix bug Created 6 years, 4 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/core/SkPictureData.h ('k') | src/core/SkPictureRecord.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 2011 Google Inc. 2 * Copyright 2011 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 #include <new> 7 #include <new>
8 #include "SkBBoxHierarchy.h" 8 #include "SkBBoxHierarchy.h"
9 #include "SkDrawPictureCallback.h" 9 #include "SkDrawPictureCallback.h"
10 #include "SkPictureData.h" 10 #include "SkPictureData.h"
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 GrPixelConfig config, SkScalar d pi) const { 677 GrPixelConfig config, SkScalar d pi) const {
678 678
679 if (context != NULL) { 679 if (context != NULL) {
680 return this->suitableForGpuRasterization(context, reason, 680 return this->suitableForGpuRasterization(context, reason,
681 context->getRecommendedSampleCo unt(config, dpi)); 681 context->getRecommendedSampleCo unt(config, dpi));
682 } else { 682 } else {
683 return this->suitableForGpuRasterization(NULL, reason); 683 return this->suitableForGpuRasterization(NULL, reason);
684 } 684 }
685 } 685 }
686 686
687 bool SkPictureData::suitableForLayerOptimization() const {
688 return fContentInfo.numLayers() > 0;
689 }
687 #endif 690 #endif
688 /////////////////////////////////////////////////////////////////////////////// 691 ///////////////////////////////////////////////////////////////////////////////
689 692
690 #ifdef SK_DEBUG_SIZE 693 #ifdef SK_DEBUG_SIZE
691 int SkPictureData::size(size_t* sizePtr) { 694 int SkPictureData::size(size_t* sizePtr) {
692 int objects = bitmaps(sizePtr); 695 int objects = bitmaps(sizePtr);
693 objects += paints(sizePtr); 696 objects += paints(sizePtr);
694 objects += paths(sizePtr); 697 objects += paths(sizePtr);
695 objects += pictures(sizePtr); 698 objects += pictures(sizePtr);
696 objects += regions(sizePtr); 699 objects += regions(sizePtr);
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 for (index = 0; index < fPictureCount; index++) 1191 for (index = 0; index < fPictureCount; index++)
1189 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ), 1192 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ),
1190 "picture%p, ", fPictureRefs[index]); 1193 "picture%p, ", fPictureRefs[index]);
1191 if (fPictureCount > 0) 1194 if (fPictureCount > 0)
1192 SkDebugf("%s0};\n", pBuffer); 1195 SkDebugf("%s0};\n", pBuffer);
1193 1196
1194 const_cast<SkPictureData*>(this)->dumpStream(); 1197 const_cast<SkPictureData*>(this)->dumpStream();
1195 } 1198 }
1196 1199
1197 #endif 1200 #endif
OLDNEW
« no previous file with comments | « src/core/SkPictureData.h ('k') | src/core/SkPictureRecord.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698