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

Unified Diff: tools/vulkan/Window.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/Window.h ('k') | tools/vulkan/android/VulkanTestContext_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/vulkan/Window.cpp
diff --git a/tools/vulkan/Window.cpp b/tools/vulkan/Window.cpp
deleted file mode 100644
index 9042a0cb699df29969a3d5aa6bd3f2854fd464f1..0000000000000000000000000000000000000000
--- a/tools/vulkan/Window.cpp
+++ /dev/null
@@ -1,74 +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 "Window.h"
-
-#include "SkSurface.h"
-#include "SkCanvas.h"
-#include "VulkanTestContext.h"
-
-static bool default_char_func(SkUnichar c, uint32_t modifiers, void* userData) {
- return false;
-}
-
-static bool default_key_func(Window::Key key, Window::InputState state, uint32_t modifiers,
- void* userData) {
- return false;
-}
-
-static bool default_mouse_func(int x, int y, Window::InputState state, uint32_t modifiers,
- void* userData) {
- return false;
-}
-
-static void default_paint_func(SkCanvas*, void* userData) {}
-
-Window::Window() : fCharFunc(default_char_func)
- , fKeyFunc(default_key_func)
- , fMouseFunc(default_mouse_func)
- , fPaintFunc(default_paint_func) {
-}
-
-void Window::detach() {
- delete fTestContext;
- fTestContext = nullptr;
-}
-
-bool Window::onChar(SkUnichar c, uint32_t modifiers) {
- return fCharFunc(c, modifiers, fCharUserData);
-}
-
-bool Window::onKey(Key key, InputState state, uint32_t modifiers) {
- return fKeyFunc(key, state, modifiers, fKeyUserData);
-}
-
-bool Window::onMouse(int x, int y, InputState state, uint32_t modifiers) {
- return fMouseFunc(x, y, state, modifiers, fMouseUserData);
-}
-
-void Window::onPaint() {
- SkSurface* backbuffer = fTestContext->getBackbufferSurface();
- if (backbuffer) {
- // draw into the canvas of this surface
- SkCanvas* canvas = backbuffer->getCanvas();
-
- fPaintFunc(canvas, fPaintUserData);
-
- canvas->flush();
-
- fTestContext->swapBuffers();
- } else {
- // try recreating testcontext
- }
-
-}
-
-void Window::onResize(uint32_t w, uint32_t h) {
- fWidth = w;
- fHeight = h;
- fTestContext->resize(w, h);
-}
« no previous file with comments | « tools/vulkan/Window.h ('k') | tools/vulkan/android/VulkanTestContext_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698