OLD | NEW |
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 "SampleApp.h" | 10 #include "SampleApp.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 m_getMSAASampleCount = NULL; | 51 m_getMSAASampleCount = NULL; |
52 } | 52 } |
53 } gWindowGlue; | 53 } gWindowGlue; |
54 | 54 |
55 SampleWindow* gWindow; | 55 SampleWindow* gWindow; |
56 | 56 |
57 /////////////////////////////////////////// | 57 /////////////////////////////////////////// |
58 ///////////// SkOSWindow impl ///////////// | 58 ///////////// SkOSWindow impl ///////////// |
59 /////////////////////////////////////////// | 59 /////////////////////////////////////////// |
60 | 60 |
| 61 SkOSWindow::SkOSWindow(void*) : fDestroyRequested(false) { |
| 62 } |
| 63 |
| 64 SkOSWindow::~SkOSWindow() { |
| 65 } |
| 66 |
61 bool SkOSWindow::attach(SkBackEndTypes /* attachType */, int /*msaaSampleCount*/
, AttachmentInfo* info) | 67 bool SkOSWindow::attach(SkBackEndTypes /* attachType */, int /*msaaSampleCount*/
, AttachmentInfo* info) |
62 { | 68 { |
63 JNIEnv* env = gActivityGlue.m_env; | 69 JNIEnv* env = gActivityGlue.m_env; |
64 if (!env || !gWindowGlue.m_getMSAASampleCount || !gWindowGlue.m_obj) { | 70 if (!env || !gWindowGlue.m_getMSAASampleCount || !gWindowGlue.m_obj) { |
65 return false; | 71 return false; |
66 } | 72 } |
67 if (env->IsSameObject(gWindowGlue.m_obj, NULL)) { | 73 if (env->IsSameObject(gWindowGlue.m_obj, NULL)) { |
68 SkDebugf("ERROR: The JNI WeakRef to the Window is invalid"); | 74 SkDebugf("ERROR: The JNI WeakRef to the Window is invalid"); |
69 return false; | 75 return false; |
70 } | 76 } |
71 info->fSampleCount = env->CallIntMethod(gWindowGlue.m_obj, gWindowGlue.m_get
MSAASampleCount); | 77 info->fSampleCount = env->CallIntMethod(gWindowGlue.m_obj, gWindowGlue.m_get
MSAASampleCount); |
72 | 78 |
73 // This is the value requested in SkiaSampleView.java. | 79 // This is the value requested in SkiaSampleView.java. |
74 info->fStencilBits = 8; | 80 info->fStencilBits = 8; |
75 return true; | 81 return true; |
76 } | 82 } |
77 | 83 |
| 84 void SkOSWindow::detach() { |
| 85 } |
| 86 |
| 87 void SkOSWindow::present() { |
| 88 } |
| 89 |
| 90 void SkOSWindow::closeWindow() { |
| 91 } |
| 92 |
| 93 void SkOSWindow::setVsync(bool) { |
| 94 } |
| 95 |
78 void SkOSWindow::onSetTitle(const char title[]) | 96 void SkOSWindow::onSetTitle(const char title[]) |
79 { | 97 { |
80 JNIEnv* env = gActivityGlue.m_env; | 98 JNIEnv* env = gActivityGlue.m_env; |
81 if (!env) { | 99 if (!env) { |
82 return; | 100 return; |
83 } | 101 } |
84 if (env->IsSameObject(gActivityGlue.m_obj, NULL)) { | 102 if (env->IsSameObject(gActivityGlue.m_obj, NULL)) { |
85 SkDebugf("ERROR: The JNI WeakRef to the Activity is invalid"); | 103 SkDebugf("ERROR: The JNI WeakRef to the Activity is invalid"); |
86 return; | 104 return; |
87 } | 105 } |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 JNIEnv* env, jobject thiz) | 375 JNIEnv* env, jobject thiz) |
358 { | 376 { |
359 gWindow->saveToPdf(); | 377 gWindow->saveToPdf(); |
360 } | 378 } |
361 | 379 |
362 JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_postInval( | 380 JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_postInval( |
363 JNIEnv* env, jobject thiz) | 381 JNIEnv* env, jobject thiz) |
364 { | 382 { |
365 gWindow->postInvalDelay(); | 383 gWindow->postInvalDelay(); |
366 } | 384 } |
OLD | NEW |