OLD | NEW |
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 Loading... |
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 } | |
690 #endif | 687 #endif |
691 /////////////////////////////////////////////////////////////////////////////// | 688 /////////////////////////////////////////////////////////////////////////////// |
692 | 689 |
693 #ifdef SK_DEBUG_SIZE | 690 #ifdef SK_DEBUG_SIZE |
694 int SkPictureData::size(size_t* sizePtr) { | 691 int SkPictureData::size(size_t* sizePtr) { |
695 int objects = bitmaps(sizePtr); | 692 int objects = bitmaps(sizePtr); |
696 objects += paints(sizePtr); | 693 objects += paints(sizePtr); |
697 objects += paths(sizePtr); | 694 objects += paths(sizePtr); |
698 objects += pictures(sizePtr); | 695 objects += pictures(sizePtr); |
699 objects += regions(sizePtr); | 696 objects += regions(sizePtr); |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 for (index = 0; index < fPictureCount; index++) | 1188 for (index = 0; index < fPictureCount; index++) |
1192 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer
), | 1189 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer
), |
1193 "picture%p, ", fPictureRefs[index]); | 1190 "picture%p, ", fPictureRefs[index]); |
1194 if (fPictureCount > 0) | 1191 if (fPictureCount > 0) |
1195 SkDebugf("%s0};\n", pBuffer); | 1192 SkDebugf("%s0};\n", pBuffer); |
1196 | 1193 |
1197 const_cast<SkPictureData*>(this)->dumpStream(); | 1194 const_cast<SkPictureData*>(this)->dumpStream(); |
1198 } | 1195 } |
1199 | 1196 |
1200 #endif | 1197 #endif |
OLD | NEW |