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

Unified Diff: examples/ui/pdf_viewer/pdf_viewer.cc

Issue 2011713003: Roll skia to 8cc209111876b7c78b5ec577c9221d8ed5e21024 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « examples/ui/noodles/noodles_view.cc ('k') | examples/ui/png_viewer/png_viewer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/ui/pdf_viewer/pdf_viewer.cc
diff --git a/examples/ui/pdf_viewer/pdf_viewer.cc b/examples/ui/pdf_viewer/pdf_viewer.cc
index d1e463d738ce86533c1774a59d878874d4707922..f16be50ed1dfd8ffbf6889304cfcebfed0a39aac 100644
--- a/examples/ui/pdf_viewer/pdf_viewer.cc
+++ b/examples/ui/pdf_viewer/pdf_viewer.cc
@@ -48,7 +48,7 @@ class PDFDocument {
uint32_t page_count() { return page_count_; }
- skia::RefPtr<SkImage> DrawPage(int page_index, const mojo::Size& size) {
+ sk_sp<SkImage> DrawPage(int page_index, const mojo::Size& size) {
FPDF_PAGE page = FPDF_LoadPage(doc_, page_index);
double width_pts = FPDF_GetPageWidth(page);
@@ -64,8 +64,7 @@ class PDFDocument {
}
int stride = width * 4;
- skia::RefPtr<SkData> pixels =
- skia::AdoptRef(SkData::NewUninitialized(stride * height));
+ sk_sp<SkData> pixels = SkData::MakeUninitialized(stride * height);
DCHECK(pixels);
FPDF_BITMAP bitmap = FPDFBitmap_CreateEx(width, height, FPDFBitmap_BGRA,
@@ -78,7 +77,7 @@ class PDFDocument {
SkImageInfo info = SkImageInfo::Make(width, height, kBGRA_8888_SkColorType,
kOpaque_SkAlphaType);
- return skia::AdoptRef(SkImage::NewRasterData(info, pixels.get(), stride));
+ return SkImage::MakeRasterData(info, pixels, stride);
}
private:
@@ -244,13 +243,13 @@ class PDFDocumentView : public mojo::ui::GaneshView,
}
void Redraw() {
- cached_image_.clear();
+ cached_image_.reset();
choreographer_.ScheduleDraw();
}
std::shared_ptr<PDFDocument> pdf_document_;
uint32_t page_ = 0u;
- skia::RefPtr<SkImage> cached_image_;
+ sk_sp<SkImage> cached_image_;
mojo::ui::Choreographer choreographer_;
mojo::ui::InputHandler input_handler_;
« no previous file with comments | « examples/ui/noodles/noodles_view.cc ('k') | examples/ui/png_viewer/png_viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698