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

Side by Side Diff: src/svg/SkSVGDevice.cpp

Issue 1018953003: Add SkEncodedFormat, used by SkCodec. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use a common enum for SkImageEncoder and SkImageDecoder and SkCodec Created 5 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
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "SkSVGDevice.h" 8 #include "SkSVGDevice.h"
9 9
10 #include "SkBase64.h" 10 #include "SkBase64.h"
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 635
636 void SkSVGDevice::drawPath(const SkDraw& draw, const SkPath& path, const SkPaint & paint, 636 void SkSVGDevice::drawPath(const SkDraw& draw, const SkPath& path, const SkPaint & paint,
637 const SkMatrix* prePathMatrix, bool pathIsMutable) { 637 const SkMatrix* prePathMatrix, bool pathIsMutable) {
638 AutoElement elem("path", fWriter, fResourceBucket, draw, paint); 638 AutoElement elem("path", fWriter, fResourceBucket, draw, paint);
639 elem.addPathAttributes(path); 639 elem.addPathAttributes(path);
640 } 640 }
641 641
642 void SkSVGDevice::drawBitmapCommon(const SkDraw& draw, const SkBitmap& bm, 642 void SkSVGDevice::drawBitmapCommon(const SkDraw& draw, const SkBitmap& bm,
643 const SkPaint& paint) { 643 const SkPaint& paint) {
644 SkAutoTUnref<const SkData> pngData( 644 SkAutoTUnref<const SkData> pngData(
645 SkImageEncoder::EncodeData(bm, SkImageEncoder::kPNG_Type, SkImageEncoder ::kDefaultQuality)); 645 SkImageEncoder::EncodeData(bm, kPNG_SkEncodedFormat, SkImageEncoder::kDe faultQuality));
646 if (!pngData) { 646 if (!pngData) {
647 return; 647 return;
648 } 648 }
649 649
650 size_t b64Size = SkBase64::Encode(pngData->data(), pngData->size(), NULL); 650 size_t b64Size = SkBase64::Encode(pngData->data(), pngData->size(), NULL);
651 SkAutoTMalloc<char> b64Data(b64Size); 651 SkAutoTMalloc<char> b64Data(b64Size);
652 SkBase64::Encode(pngData->data(), pngData->size(), b64Data.get()); 652 SkBase64::Encode(pngData->data(), pngData->size(), b64Data.get());
653 653
654 SkString svgImageData("data:image/png;base64,"); 654 SkString svgImageData("data:image/png;base64,");
655 svgImageData.append(b64Data.get(), b64Size); 655 svgImageData.append(b64Data.get(), b64Size);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 const SkPaint& paint) { 786 const SkPaint& paint) {
787 // todo 787 // todo
788 SkDebugf("unsupported operation: drawVertices()\n"); 788 SkDebugf("unsupported operation: drawVertices()\n");
789 } 789 }
790 790
791 void SkSVGDevice::drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, 791 void SkSVGDevice::drawDevice(const SkDraw&, SkBaseDevice*, int x, int y,
792 const SkPaint&) { 792 const SkPaint&) {
793 // todo 793 // todo
794 SkDebugf("unsupported operation: drawDevice()\n"); 794 SkDebugf("unsupported operation: drawDevice()\n");
795 } 795 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698