summaryrefslogtreecommitdiff
path: root/chromium/content/common/font_config_ipc_linux.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-08-01 12:59:39 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-08-04 12:40:43 +0000
commit28b1110370900897ab652cb420c371fab8857ad4 (patch)
tree41b32127d23b0df4f2add2a27e12dc87bddb260e /chromium/content/common/font_config_ipc_linux.cc
parent399c965b6064c440ddcf4015f5f8e9d131c7a0a6 (diff)
downloadqtwebengine-chromium-28b1110370900897ab652cb420c371fab8857ad4.tar.gz
BASELINE: Update Chromium to 53.0.2785.41
Also adds a few extra files for extensions. Change-Id: Iccdd55d98660903331cf8b7b29188da781830af4 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/content/common/font_config_ipc_linux.cc')
-rw-r--r--chromium/content/common/font_config_ipc_linux.cc23
1 files changed, 12 insertions, 11 deletions
diff --git a/chromium/content/common/font_config_ipc_linux.cc b/chromium/content/common/font_config_ipc_linux.cc
index fff2fb95c89..0c65468b75d 100644
--- a/chromium/content/common/font_config_ipc_linux.cc
+++ b/chromium/content/common/font_config_ipc_linux.cc
@@ -15,6 +15,7 @@
#include <functional>
#include <memory>
+#include <utility>
#include "base/files/file_util.h"
#include "base/files/memory_mapped_file.h"
@@ -23,9 +24,9 @@
#include "base/posix/unix_domain_socket_linux.h"
#include "base/threading/thread_restrictions.h"
#include "base/trace_event/trace_event.h"
-#include "skia/ext/refptr.h"
#include "skia/ext/skia_utils_base.h"
#include "third_party/skia/include/core/SkData.h"
+#include "third_party/skia/include/core/SkRefCnt.h"
#include "third_party/skia/include/core/SkStream.h"
#include "third_party/skia/include/core/SkTypeface.h"
@@ -123,13 +124,13 @@ SkMemoryStream* FontConfigIPC::mapFileDescriptorToStream(int fd) {
mapped_font_file->Initialize(base::File(fd));
DCHECK(mapped_font_file->IsValid());
- auto data = skia::AdoptRef(
- SkData::NewWithProc(mapped_font_file->data(), mapped_font_file->length(),
- &DestroyMemoryMappedFile, mapped_font_file.get()));
+ sk_sp<SkData> data =
+ SkData::MakeWithProc(mapped_font_file->data(), mapped_font_file->length(),
+ &DestroyMemoryMappedFile, mapped_font_file.get());
if (!data)
return nullptr;
ignore_result(mapped_font_file.release()); // Ownership transferred to SkDataB
- return new SkMemoryStream(data.get());
+ return new SkMemoryStream(std::move(data));
}
SkStreamAsset* FontConfigIPC::openStream(const FontIdentity& identity) {
@@ -158,21 +159,21 @@ SkStreamAsset* FontConfigIPC::openStream(const FontIdentity& identity) {
return mapFileDescriptorToStream(result_fd);
}
-SkTypeface* FontConfigIPC::createTypeface(
+sk_sp<SkTypeface> FontConfigIPC::makeTypeface(
const SkFontConfigInterface::FontIdentity& identity) {
base::AutoLock lock(lock_);
auto mapped_typefaces_it = mapped_typefaces_.Get(identity);
if (mapped_typefaces_it != mapped_typefaces_.end())
- return SkSafeRef(mapped_typefaces_it->second.get());
+ return mapped_typefaces_it->second;
SkStreamAsset* typeface_stream = openStream(identity);
if (!typeface_stream)
return nullptr;
- skia::RefPtr<SkTypeface> typeface_from_stream = skia::AdoptRef(
- SkTypeface::CreateFromStream(typeface_stream, identity.fTTCIndex));
+ sk_sp<SkTypeface> typeface_from_stream(
+ SkTypeface::MakeFromStream(typeface_stream, identity.fTTCIndex));
auto mapped_typefaces_insert_it =
- mapped_typefaces_.Put(identity, typeface_from_stream);
- return SkSafeRef(mapped_typefaces_insert_it->second.get());
+ mapped_typefaces_.Put(identity, std::move(typeface_from_stream));
+ return mapped_typefaces_insert_it->second;
}
} // namespace content