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
This commit is contained in:
2
DEPS
2
DEPS
@@ -16,7 +16,7 @@ vars = {
|
|||||||
"libjingle_revision": "66",
|
"libjingle_revision": "66",
|
||||||
"libvpx_revision": "90416",
|
"libvpx_revision": "90416",
|
||||||
"ffmpeg_revision": "88382",
|
"ffmpeg_revision": "88382",
|
||||||
"skia_revision": "1690",
|
"skia_revision": "1722",
|
||||||
"v8_revision": "8431",
|
"v8_revision": "8431",
|
||||||
"webrtc_revision": "90",
|
"webrtc_revision": "90",
|
||||||
}
|
}
|
||||||
|
@@ -10,6 +10,7 @@
|
|||||||
#include "base/hash_tables.h"
|
#include "base/hash_tables.h"
|
||||||
#include "base/metrics/histogram.h"
|
#include "base/metrics/histogram.h"
|
||||||
#include "skia/ext/vector_platform_device_skia.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/SkRefCnt.h"
|
||||||
#include "third_party/skia/include/core/SkScalar.h"
|
#include "third_party/skia/include/core/SkScalar.h"
|
||||||
#include "third_party/skia/include/core/SkStream.h"
|
#include "third_party/skia/include/core/SkStream.h"
|
||||||
@@ -125,13 +126,16 @@ bool PdfMetafileSkia::GetData(void* dst_buffer,
|
|||||||
if (dst_buffer_size < GetDataSize())
|
if (dst_buffer_size < GetDataSize())
|
||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PdfMetafileSkia::SaveTo(const FilePath& file_path) const {
|
bool PdfMetafileSkia::SaveTo(const FilePath& file_path) const {
|
||||||
DCHECK_GT(data_->pdf_stream_.getOffset(), 0U);
|
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())) {
|
GetDataSize()) != static_cast<int>(GetDataSize())) {
|
||||||
DLOG(ERROR) << "Failed to save file " << file_path.value().c_str();
|
DLOG(ERROR) << "Failed to save file " << file_path.value().c_str();
|
||||||
return false;
|
return false;
|
||||||
@@ -189,9 +193,10 @@ bool PdfMetafileSkia::RenderPage(unsigned int page_number,
|
|||||||
bool center_horizontally,
|
bool center_horizontally,
|
||||||
bool center_vertically) const {
|
bool center_vertically) const {
|
||||||
DCHECK_GT(data_->pdf_stream_.getOffset(), 0U);
|
DCHECK_GT(data_->pdf_stream_.getOffset(), 0U);
|
||||||
if (data_->pdf_cg_.GetDataSize() == 0)
|
if (data_->pdf_cg_.GetDataSize() == 0) {
|
||||||
data_->pdf_cg_.InitFromData(data_->pdf_stream_.getStream(),
|
SkAutoDataUnref data(data_->pdf_stream_.copyToData());
|
||||||
data_->pdf_stream_.getOffset());
|
data_->pdf_cg_.InitFromData(data.bytes(), data.size());
|
||||||
|
}
|
||||||
return data_->pdf_cg_.RenderPage(page_number, context, rect, shrink_to_fit,
|
return data_->pdf_cg_.RenderPage(page_number, context, rect, shrink_to_fit,
|
||||||
stretch_to_fit, center_horizontally,
|
stretch_to_fit, center_horizontally,
|
||||||
center_vertically);
|
center_vertically);
|
||||||
@@ -208,7 +213,9 @@ bool PdfMetafileSkia::SaveToFD(const base::FileDescriptor& fd) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool result = true;
|
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()) !=
|
GetDataSize()) !=
|
||||||
static_cast<int>(GetDataSize())) {
|
static_cast<int>(GetDataSize())) {
|
||||||
DLOG(ERROR) << "Failed to save file with fd " << fd.fd;
|
DLOG(ERROR) << "Failed to save file with fd " << fd.fd;
|
||||||
|
@@ -311,6 +311,7 @@
|
|||||||
'../third_party/skia/src/core/SkCoreBlitters.h',
|
'../third_party/skia/src/core/SkCoreBlitters.h',
|
||||||
'../third_party/skia/src/core/SkCubicClipper.cpp',
|
'../third_party/skia/src/core/SkCubicClipper.cpp',
|
||||||
'../third_party/skia/src/core/SkCubicClipper.h',
|
'../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.cpp',
|
||||||
#'../third_party/skia/src/core/SkDebug_stdio.cpp',
|
#'../third_party/skia/src/core/SkDebug_stdio.cpp',
|
||||||
'../third_party/skia/src/core/SkDeque.cpp',
|
'../third_party/skia/src/core/SkDeque.cpp',
|
||||||
@@ -527,6 +528,7 @@
|
|||||||
'../third_party/skia/include/core/SkColorPriv.h',
|
'../third_party/skia/include/core/SkColorPriv.h',
|
||||||
'../third_party/skia/include/core/SkColorShader.h',
|
'../third_party/skia/include/core/SkColorShader.h',
|
||||||
'../third_party/skia/include/core/SkComposeShader.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/SkDeque.h',
|
||||||
'../third_party/skia/include/core/SkDescriptor.h',
|
'../third_party/skia/include/core/SkDescriptor.h',
|
||||||
'../third_party/skia/include/core/SkDevice.h',
|
'../third_party/skia/include/core/SkDevice.h',
|
||||||
|
Reference in New Issue
Block a user