diff options
author | Derek Sollenberger <djsollen@google.com> | 2010-11-16 14:19:01 -0500 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2010-11-16 15:41:13 -0500 |
commit | ffa561e00d3934de9451bf599a2d4f355a33041b (patch) | |
tree | 76cc8a2a5947678f0b6d6e5e275cd9f954602ae0 /src/com/android/browser/BrowserActivity.java | |
parent | e5e8175d73f3e6e0176d84117797ac0165c54b0c (diff) | |
download | packages_apps_Browser-ffa561e00d3934de9451bf599a2d4f355a33041b.zip packages_apps_Browser-ffa561e00d3934de9451bf599a2d4f355a33041b.tar.gz packages_apps_Browser-ffa561e00d3934de9451bf599a2d4f355a33041b.tar.bz2 |
Allow HW accleration to be activated on demand.
This CL adds a debugging preference that allows developers to
enable/disable Open GL rendering on demand. The setting change
does not take effect until the browser is restarted.
bug: 3185844
Change-Id: Ifcf5a7b7d4ddbf02a649a28c4f462e2da3f34bb6
Diffstat (limited to 'src/com/android/browser/BrowserActivity.java')
-rw-r--r-- | src/com/android/browser/BrowserActivity.java | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index b882338..ef26145 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -24,7 +24,6 @@ import com.android.common.speech.LoggingEvents; import android.app.ActionBar; import android.app.Activity; import android.app.AlertDialog; -import android.app.Dialog; import android.app.DownloadManager; import android.app.ProgressDialog; import android.app.SearchManager; @@ -43,7 +42,6 @@ import android.content.IntentFilter; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.res.Configuration; -import android.content.res.Resources; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; @@ -71,7 +69,6 @@ import android.provider.BrowserContract; import android.provider.BrowserContract.Images; import android.provider.ContactsContract; import android.provider.ContactsContract.Intents.Insert; -import android.provider.Downloads; import android.provider.MediaStore; import android.speech.RecognizerResultsIntent; import android.text.TextUtils; @@ -105,7 +102,6 @@ import android.webkit.WebHistoryItem; import android.webkit.WebIconDatabase; import android.webkit.WebSettings; import android.webkit.WebView; -import android.widget.EditText; import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.TextView; @@ -172,8 +168,19 @@ public class BrowserActivity extends Activity Log.v(LOGTAG, this + " onStart"); } super.onCreate(icicle); - // test the browser in OpenGL - // requestWindowFeature(Window.FEATURE_OPENGL); + + // Keep a settings instance handy. + mSettings = BrowserSettings.getInstance(); + + // render the browser in OpenGL + if (mSettings.isHardwareAccelerated()) { + // Set the flag in the activity's window + this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, + WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + } else { + // Clear the flag in the activity's window + this.getWindow().setFlags(0, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + } // enable this to test the browser in 32bit if (false) { @@ -189,9 +196,6 @@ public class BrowserActivity extends Activity mResolver = getContentResolver(); - // Keep a settings instance handy. - mSettings = BrowserSettings.getInstance(); - // If this was a web search request, pass it on to the default web // search provider and finish this activity. if (handleWebSearchIntent(getIntent())) { |