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

Side by Side Diff: experimental/GLFWTest/glfw_main.cpp

Issue 2206633004: Move off SK_SUPPORT_LEGACY_DATA_FACTORIES. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Gotta catch 'em all. Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GLFW/glfw3.h" 8 #include "GLFW/glfw3.h"
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 init_skia(kWidth, kHeight); 77 init_skia(kWidth, kHeight);
78 78
79 SkAutoTUnref<SkImage> atlas; 79 SkAutoTUnref<SkImage> atlas;
80 SkRSXform xform[kGrid*kGrid+1]; 80 SkRSXform xform[kGrid*kGrid+1];
81 SkRect tex[kGrid*kGrid+1]; 81 SkRect tex[kGrid*kGrid+1];
82 WallTimer timer; 82 WallTimer timer;
83 float times[32]; 83 float times[32];
84 int currentTime; 84 int currentTime;
85 85
86 SkAutoTUnref<SkData> imageData(SkData::NewFromFileName("ship.png")); 86 sk_sp<SkData> imageData(SkData::MakeFromFileName("ship.png"));
87 atlas.reset(SkImage::NewFromEncoded(imageData)); 87 atlas.reset(SkImage::NewFromEncoded(imageData.get()));
88 if (!atlas) { 88 if (!atlas) {
89 SkDebugf("\nCould not decode file ship.png\n"); 89 SkDebugf("\nCould not decode file ship.png\n");
90 90
91 cleanup_skia(); 91 cleanup_skia();
92 glfwDestroyWindow(window); 92 glfwDestroyWindow(window);
93 glfwTerminate(); 93 glfwTerminate();
94 exit(EXIT_FAILURE); 94 exit(EXIT_FAILURE);
95 } 95 }
96 96
97 SkScalar anchorX = atlas->width()*0.5f; 97 SkScalar anchorX = atlas->width()*0.5f;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 170
171 glfwSwapBuffers(window); 171 glfwSwapBuffers(window);
172 } 172 }
173 173
174 cleanup_skia(); 174 cleanup_skia();
175 175
176 glfwDestroyWindow(window); 176 glfwDestroyWindow(window);
177 glfwTerminate(); 177 glfwTerminate();
178 exit(EXIT_SUCCESS); 178 exit(EXIT_SUCCESS);
179 } 179 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698