Skip to content

Commit

Permalink
[fuchsia] Update for SizedVmoTransport to Buffer rename (#4946)
Browse files Browse the repository at this point in the history
  • Loading branch information
abarth authored Apr 7, 2018
1 parent 5156f92 commit 0122d58
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions content_handler/fuchsia_font_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ void UnmapMemory(const void* buffer, void* context) {
zx::vmar::root_self().unmap(reinterpret_cast<uintptr_t>(buffer), size);
}

sk_sp<SkData> MakeSkDataFromVMO(fsl::SizedVmoTransport vmo) {
if (!fsl::SizedVmo::IsSizeValid(vmo.vmo, vmo.size) ||
vmo.size > std::numeric_limits<size_t>::max()) {
sk_sp<SkData> MakeSkDataFromBuffer(mem::Buffer data) {
if (!fsl::SizedVmo::IsSizeValid(data.vmo, data.size) ||
data.size > std::numeric_limits<size_t>::max()) {
return nullptr;
}
uint64_t size = vmo.size;
uint64_t size = data.size;
uintptr_t buffer = 0;
zx_status_t status = zx::vmar::root_self().map(0, vmo.vmo, 0, size,
zx_status_t status = zx::vmar::root_self().map(0, data.vmo, 0, size,
ZX_VM_FLAG_PERM_READ, &buffer);
if (status != ZX_OK)
return nullptr;
Expand Down Expand Up @@ -107,7 +107,7 @@ SkTypeface* FuchsiaFontManager::onMatchFamilyStyle(
if (!response)
return nullptr;

sk_sp<SkData> data = MakeSkDataFromVMO(std::move(response->data.vmo));
sk_sp<SkData> data = MakeSkDataFromBuffer(std::move(response->data.buffer));
if (!data)
return nullptr;

Expand Down
12 changes: 6 additions & 6 deletions sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ void UnmapMemory(const void* buffer, void* context) {
zx::vmar::root_self().unmap(reinterpret_cast<uintptr_t>(buffer), size);
}

sk_sp<SkData> MakeSkDataFromVMO(const fsl::SizedVmoTransport& vmo) {
if (!fsl::SizedVmo::IsSizeValid(vmo.vmo, vmo.size) ||
vmo.size > std::numeric_limits<size_t>::max()) {
sk_sp<SkData> MakeSkDataFromBuffer(const mem::Buffer& data) {
if (!fsl::SizedVmo::IsSizeValid(data.vmo, data.size) ||
data.size > std::numeric_limits<size_t>::max()) {
return nullptr;
}
uint64_t size = vmo.size;
uint64_t size = data.size;
uintptr_t buffer = 0;
zx_status_t status = zx::vmar::root_self().map(0, vmo.vmo, 0, size,
zx_status_t status = zx::vmar::root_self().map(0, data.vmo, 0, size,
ZX_VM_FLAG_PERM_READ, &buffer);
if (status != ZX_OK)
return nullptr;
Expand Down Expand Up @@ -132,7 +132,7 @@ sk_sp<SkTypeface> FontCache::createTypeface(
if (!response)
return nullptr;

sk_sp<SkData> data = MakeSkDataFromVMO(response->data.vmo);
sk_sp<SkData> data = MakeSkDataFromBuffer(response->data.buffer);
if (!data)
return nullptr;

Expand Down

0 comments on commit 0122d58

Please sign in to comment.