| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 package com.skia; | 8 package com.skia; |
| 9 | 9 |
| 10 import android.opengl.GLSurfaceView; | 10 import android.opengl.GLSurfaceView; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 @Override | 30 @Override |
| 31 public void onSurfaceChanged(GL10 gl, int width, int height) { | 31 public void onSurfaceChanged(GL10 gl, int width, int height) { |
| 32 updateSize(width, height); | 32 updateSize(width, height); |
| 33 } | 33 } |
| 34 | 34 |
| 35 @Override | 35 @Override |
| 36 public void onSurfaceCreated(GL10 gl, EGLConfig config) { | 36 public void onSurfaceCreated(GL10 gl, EGLConfig config) { |
| 37 gl.glClearStencil(0); | 37 gl.glClearStencil(0); |
| 38 gl.glClear(GL10.GL_STENCIL_BUFFER_BIT); | 38 gl.glClear(GL10.GL_STENCIL_BUFFER_BIT); |
| 39 init((SkiaSampleActivity)mSampleView.getContext()); | 39 init((SkiaSampleActivity)mSampleView.getContext(), mSampleView.getMSAASa
mpleCount()); |
| 40 } | 40 } |
| 41 | 41 |
| 42 // Called by JNI | 42 // Called by JNI |
| 43 private void startTimer(int ms) { | 43 private void startTimer(int ms) { |
| 44 // After the delay, queue an event to the Renderer's thread | 44 // After the delay, queue an event to the Renderer's thread |
| 45 // to handle the event on the timer queue | 45 // to handle the event on the timer queue |
| 46 mHandler.postDelayed(new Runnable() { | 46 mHandler.postDelayed(new Runnable() { |
| 47 @Override | 47 @Override |
| 48 public void run() { | 48 public void run() { |
| 49 mSampleView.queueEvent(new Runnable() { | 49 mSampleView.queueEvent(new Runnable() { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 64 processSkEvent(); | 64 processSkEvent(); |
| 65 } | 65 } |
| 66 }); | 66 }); |
| 67 } | 67 } |
| 68 | 68 |
| 69 // Called by JNI | 69 // Called by JNI |
| 70 private void requestRender() { | 70 private void requestRender() { |
| 71 mSampleView.requestRender(); | 71 mSampleView.requestRender(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 native void init(SkiaSampleActivity activity); | 74 // Called by JNI |
| 75 private int getMSAASampleCount() { |
| 76 return mSampleView.getMSAASampleCount(); |
| 77 } |
| 78 |
| 79 native void init(SkiaSampleActivity activity, int msaaSampleCount); |
| 75 native void term(); | 80 native void term(); |
| 76 native void draw(); | 81 native void draw(); |
| 77 native void updateSize(int w, int h); | 82 native void updateSize(int w, int h); |
| 78 native void handleClick(int owner, float x, float y, int state); | 83 native void handleClick(int owner, float x, float y, int state); |
| 79 native void showOverview(); | 84 native void showOverview(); |
| 80 native void nextSample(); | 85 native void nextSample(); |
| 81 native void previousSample(); | 86 native void previousSample(); |
| 82 native void goToSample(int position); | 87 native void goToSample(int position); |
| 83 native void toggleRenderingMode(); | 88 native void toggleRenderingMode(); |
| 84 native void toggleSlideshow(); | 89 native void toggleSlideshow(); |
| 85 native void toggleFPS(); | 90 native void toggleFPS(); |
| 86 native void toggleTiling(); | 91 native void toggleTiling(); |
| 87 native void toggleBBox(); | 92 native void toggleBBox(); |
| 88 native void processSkEvent(); | 93 native void processSkEvent(); |
| 89 native void serviceQueueTimer(); | 94 native void serviceQueueTimer(); |
| 90 native void saveToPDF(); | 95 native void saveToPDF(); |
| 91 native void postInval(); | 96 native void postInval(); |
| 92 } | 97 } |
| OLD | NEW |