diff options
author | reed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-27 16:51:20 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-27 16:51:20 +0000 |
commit | e195fbf59cb3c26b7345df1a50996822c63d89cd (patch) | |
tree | b15800017960f32a4ee923e73cccd85fb1402990 | |
parent | e67a7af68532ceef2b02bd228344392226e0ab34 (diff) | |
download | chromium_src-e195fbf59cb3c26b7345df1a50996822c63d89cd.zip chromium_src-e195fbf59cb3c26b7345df1a50996822c63d89cd.tar.gz chromium_src-e195fbf59cb3c26b7345df1a50996822c63d89cd.tar.bz2 |
roll skia
Review URL: http://codereview.chromium.org/7235024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90595 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | DEPS | 2 | ||||
-rw-r--r-- | printing/pdf_metafile_skia.cc | 19 | ||||
-rw-r--r-- | skia/skia.gyp | 2 |
3 files changed, 16 insertions, 7 deletions
@@ -16,7 +16,7 @@ vars = { "libjingle_revision": "66", "libvpx_revision": "90416", "ffmpeg_revision": "88382", - "skia_revision": "1690", + "skia_revision": "1722", "v8_revision": "8431", "webrtc_revision": "90", } diff --git a/printing/pdf_metafile_skia.cc b/printing/pdf_metafile_skia.cc index d335545..0ef33f2 100644 --- a/printing/pdf_metafile_skia.cc +++ b/printing/pdf_metafile_skia.cc @@ -10,6 +10,7 @@ #include "base/hash_tables.h" #include "base/metrics/histogram.h" #include "skia/ext/vector_platform_device_skia.h" +#include "third_party/skia/include/core/SkData.h" #include "third_party/skia/include/core/SkRefCnt.h" #include "third_party/skia/include/core/SkScalar.h" #include "third_party/skia/include/core/SkStream.h" @@ -125,13 +126,16 @@ bool PdfMetafileSkia::GetData(void* dst_buffer, if (dst_buffer_size < GetDataSize()) return false; - memcpy(dst_buffer, data_->pdf_stream_.getStream(), dst_buffer_size); + SkAutoDataUnref data(data_->pdf_stream_.copyToData()); + memcpy(dst_buffer, data.bytes(), dst_buffer_size); return true; } bool PdfMetafileSkia::SaveTo(const FilePath& file_path) const { DCHECK_GT(data_->pdf_stream_.getOffset(), 0U); - if (file_util::WriteFile(file_path, data_->pdf_stream_.getStream(), + SkAutoDataUnref data(data_->pdf_stream_.copyToData()); + if (file_util::WriteFile(file_path, + reinterpret_cast<const char*>(data.data()), GetDataSize()) != static_cast<int>(GetDataSize())) { DLOG(ERROR) << "Failed to save file " << file_path.value().c_str(); return false; @@ -189,9 +193,10 @@ bool PdfMetafileSkia::RenderPage(unsigned int page_number, bool center_horizontally, bool center_vertically) const { DCHECK_GT(data_->pdf_stream_.getOffset(), 0U); - if (data_->pdf_cg_.GetDataSize() == 0) - data_->pdf_cg_.InitFromData(data_->pdf_stream_.getStream(), - data_->pdf_stream_.getOffset()); + if (data_->pdf_cg_.GetDataSize() == 0) { + SkAutoDataUnref data(data_->pdf_stream_.copyToData()); + data_->pdf_cg_.InitFromData(data.bytes(), data.size()); + } return data_->pdf_cg_.RenderPage(page_number, context, rect, shrink_to_fit, stretch_to_fit, center_horizontally, center_vertically); @@ -208,7 +213,9 @@ bool PdfMetafileSkia::SaveToFD(const base::FileDescriptor& fd) const { } bool result = true; - if (file_util::WriteFileDescriptor(fd.fd, data_->pdf_stream_.getStream(), + SkAutoDataUnref data(data_->pdf_stream_.copyToData()); + if (file_util::WriteFileDescriptor(fd.fd, + reinterpret_cast<const char*>(data.data()), GetDataSize()) != static_cast<int>(GetDataSize())) { DLOG(ERROR) << "Failed to save file with fd " << fd.fd; diff --git a/skia/skia.gyp b/skia/skia.gyp index 4056a04..e8fa2cc 100644 --- a/skia/skia.gyp +++ b/skia/skia.gyp @@ -311,6 +311,7 @@ '../third_party/skia/src/core/SkCoreBlitters.h', '../third_party/skia/src/core/SkCubicClipper.cpp', '../third_party/skia/src/core/SkCubicClipper.h', + '../third_party/skia/src/core/SkData.cpp', '../third_party/skia/src/core/SkDebug.cpp', #'../third_party/skia/src/core/SkDebug_stdio.cpp', '../third_party/skia/src/core/SkDeque.cpp', @@ -527,6 +528,7 @@ '../third_party/skia/include/core/SkColorPriv.h', '../third_party/skia/include/core/SkColorShader.h', '../third_party/skia/include/core/SkComposeShader.h', + '../third_party/skia/include/core/SkData.h', '../third_party/skia/include/core/SkDeque.h', '../third_party/skia/include/core/SkDescriptor.h', '../third_party/skia/include/core/SkDevice.h', |