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

Side by Side Diff: platform_tools/android/app/jni/com_skia_SkiaSampleRenderer.cpp

Issue 239703016: SkiaSampleRenderer - handle case where compiler won't cast jint to void*. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Skia 3 * Copyright 2011 Skia
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "com_skia_SkiaSampleRenderer.h" 8 #include "com_skia_SkiaSampleRenderer.h"
9 9
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 gWindow->update(NULL); 247 gWindow->update(NULL);
248 } 248 }
249 249
250 JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_updateSize(JNIEnv* env, 250 JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_updateSize(JNIEnv* env,
251 jobject thiz, jint w, jint h) 251 jobject thiz, jint w, jint h)
252 { 252 {
253 gWindow->resize(w, h); 253 gWindow->resize(w, h);
254 } 254 }
255 255
256 JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_handleClick(JNIEnv* env, 256 JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_handleClick(JNIEnv* env,
257 jobject thiz, jint owner, jfloat x, jfloat y, jint jstate) 257 jobject thiz, jint owner, jfloat x, jfloat y, jint jstate)
djsollen 2014/04/17 17:43:50 I also think we should consider updating the owner
258 { 258 {
259 SkView::Click::State state; 259 SkView::Click::State state;
260 switch(jstate) { 260 switch(jstate) {
261 case 0: // MotionEvent.ACTION_DOWN 261 case 0: // MotionEvent.ACTION_DOWN
262 state = SkView::Click::kDown_State; 262 state = SkView::Click::kDown_State;
263 break; 263 break;
264 case 1: // MotionEvent.ACTION_UP 264 case 1: // MotionEvent.ACTION_UP
265 case 3: // MotionEvent.ACTION_CANCEL 265 case 3: // MotionEvent.ACTION_CANCEL
266 state = SkView::Click::kUp_State; 266 state = SkView::Click::kUp_State;
267 break; 267 break;
268 case 2: // MotionEvent.ACTION_MOVE 268 case 2: // MotionEvent.ACTION_MOVE
269 state = SkView::Click::kMoved_State; 269 state = SkView::Click::kMoved_State;
270 break; 270 break;
271 default: 271 default:
272 SkDebugf("motion event ignored\n"); 272 SkDebugf("motion event ignored\n");
273 return; 273 return;
274 } 274 }
275 gWindow->handleClick(x, y, state, (void*) owner); 275 gWindow->handleClick(x, y, state, reinterpret_cast<void*>(owner));
276 } 276 }
277 277
278 JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_nextSample( 278 JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_nextSample(
279 JNIEnv* env, jobject thiz) 279 JNIEnv* env, jobject thiz)
280 { 280 {
281 gWindow->nextSample(); 281 gWindow->nextSample();
282 } 282 }
283 283
284 JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_previousSample( 284 JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_previousSample(
285 JNIEnv* env, jobject thiz) 285 JNIEnv* env, jobject thiz)
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 JNIEnv* env, jobject thiz) 347 JNIEnv* env, jobject thiz)
348 { 348 {
349 gWindow->saveToPdf(); 349 gWindow->saveToPdf();
350 } 350 }
351 351
352 JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_postInval( 352 JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_postInval(
353 JNIEnv* env, jobject thiz) 353 JNIEnv* env, jobject thiz)
354 { 354 {
355 gWindow->postInvalDelay(); 355 gWindow->postInvalDelay();
356 } 356 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698