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

Unified Diff: tools/vulkan/viewer/SKPSlide.cpp

Issue 1945103003: Rename VulkanViewer to Viewer, take 2. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix android path 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 | « tools/vulkan/viewer/SKPSlide.h ('k') | tools/vulkan/viewer/Slide.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/vulkan/viewer/SKPSlide.cpp
diff --git a/tools/vulkan/viewer/SKPSlide.cpp b/tools/vulkan/viewer/SKPSlide.cpp
deleted file mode 100644
index 6a9899b92fbe29ff01dfaca22ee6130e32847e05..0000000000000000000000000000000000000000
--- a/tools/vulkan/viewer/SKPSlide.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-* Copyright 2016 Google Inc.
-*
-* Use of this source code is governed by a BSD-style license that can be
-* found in the LICENSE file.
-*/
-
-#include "SKPSlide.h"
-
-#include "SkCanvas.h"
-#include "SkCommonFlags.h"
-#include "SkOSFile.h"
-#include "SkStream.h"
-
-SKPSlide::SKPSlide(const SkString& name, const SkString& path) : fPath(path) {
- fName = name;
-}
-
-SKPSlide::~SKPSlide() {}
-
-void SKPSlide::draw(SkCanvas* canvas) {
- if (fPic.get()) {
- bool isOffset = SkToBool(fCullRect.left() | fCullRect.top());
- if (isOffset) {
- canvas->save();
- canvas->translate(SkIntToScalar(-fCullRect.left()), SkIntToScalar(-fCullRect.top()));
- }
-
- canvas->drawPicture(fPic.get());
-
- if (isOffset) {
- canvas->restore();
- }
- }
-}
-
-static sk_sp<SkPicture> read_picture(const char path[]) {
- SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(path));
- if (stream.get() == nullptr) {
- SkDebugf("Could not read %s.\n", path);
- return nullptr;
- }
-
- auto pic = SkPicture::MakeFromStream(stream.get());
- if (!pic) {
- SkDebugf("Could not read %s as an SkPicture.\n", path);
- }
- return pic;
-}
-
-void SKPSlide::load() {
- fPic = read_picture(fPath.c_str());
- fCullRect = fPic->cullRect().roundOut();
-}
-
-void SKPSlide::unload() {
- fPic.reset(nullptr);
-}
« no previous file with comments | « tools/vulkan/viewer/SKPSlide.h ('k') | tools/vulkan/viewer/Slide.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698