Bug 1134599 - Fix rpi build target. r=jrmuizel, r=shuang
authorJan Jongboom <janjongboom@gmail.com>
Wed, 25 Feb 2015 03:20:00 -0500
changeset 231832 67812860b99757c686edb604387229d9ed301b1c
parent 231831 95443c5c35fd3513fadc74d6a2b8a19f3dbdb279
child 231833 c6e3576bab27e851bceaed97e4ab2018908da5d5
push id11589
push userryanvm@gmail.com
push dateWed, 04 Mar 2015 21:55:25 +0000
treeherderfx-team@56492f7244a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, shuang
bugs1134599
milestone39.0a1
Bug 1134599 - Fix rpi build target. r=jrmuizel, r=shuang
dom/canvas/CanvasRenderingContext2D.cpp
dom/system/gonk/AudioManager.cpp
gfx/2d/SourceSurfaceSkia.cpp
gfx/thebes/gfxPlatform.cpp
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -1346,19 +1346,19 @@ CanvasRenderingContext2D::EnsureTarget(R
       layerManager =
         nsContentUtils::PersistentLayerManagerForDocument(ownerDoc);
     }
 
      if (layerManager) {
       if (mode == RenderingMode::OpenGLBackendMode && CheckSizeForSkiaGL(size)) {
         DemoteOldestContextIfNecessary();
 
+#if USE_SKIA_GPU
         SkiaGLGlue* glue = gfxPlatform::GetPlatform()->GetSkiaGLGlue();
 
-#if USE_SKIA_GPU
         if (glue && glue->GetGrContext() && glue->GetGLContext()) {
           mTarget = Factory::CreateDrawTargetSkiaWithGrContext(glue->GetGrContext(), size, format);
           if (mTarget) {
             AddDemotableContext(this);
           } else {
             printf_stderr("Failed to create a SkiaGL DrawTarget, falling back to software\n");
             mode = RenderingMode::SoftwareBackendMode;
           }
--- a/dom/system/gonk/AudioManager.cpp
+++ b/dom/system/gonk/AudioManager.cpp
@@ -76,20 +76,24 @@ static int sMaxStreamVolumeTbl[AUDIO_STR
   15,  // BT SCO
   15,  // enforced audible
   15,  // DTMF
   15,  // TTS
   15,  // FM
 };
 // A bitwise variable for recording what kind of headset is attached.
 static int sHeadsetState;
+#if defined(MOZ_B2G_BT) || ANDROID_VERSION >= 17
 static bool sBluetoothA2dpEnabled;
+#endif
 static const int kBtSampleRate = 8000;
 static bool sSwitchDone = true;
+#ifdef MOZ_B2G_BT
 static bool sA2dpSwitchDone = true;
+#endif
 
 namespace mozilla {
 namespace dom {
 namespace gonk {
 class RecoverTask : public nsRunnable
 {
 public:
   RecoverTask() {}
@@ -211,28 +215,30 @@ IsDeviceOn(audio_devices_t device)
 static void ProcessDelayedAudioRoute(SwitchState aState)
 {
   if (sSwitchDone)
     return;
   InternalSetAudioRoutes(aState);
   sSwitchDone = true;
 }
 
+#ifdef MOZ_B2G_BT
 static void ProcessDelayedA2dpRoute(audio_policy_dev_state_t aState, const nsCString aAddress)
 {
   if (sA2dpSwitchDone)
     return;
   AudioSystem::setDeviceConnectionState(AUDIO_DEVICE_OUT_BLUETOOTH_A2DP,
                                         aState, aAddress.get());
   String8 cmd("bluetooth_enabled=false");
   AudioSystem::setParameters(0, cmd);
   cmd.setTo("A2dpSuspended=true");
   AudioSystem::setParameters(0, cmd);
   sA2dpSwitchDone = true;
 }
+#endif
 
 NS_IMPL_ISUPPORTS(AudioManager, nsIAudioManager, nsIObserver)
 
 static void
 InternalSetAudioRoutesICS(SwitchState aState)
 {
   if (aState == SWITCH_STATE_HEADSET) {
     AudioSystem::setDeviceConnectionState(AUDIO_DEVICE_OUT_WIRED_HEADSET,
--- a/gfx/2d/SourceSurfaceSkia.cpp
+++ b/gfx/2d/SourceSurfaceSkia.cpp
@@ -93,30 +93,32 @@ SourceSurfaceSkia::InitFromData(unsigned
 
 bool
 SourceSurfaceSkia::InitFromTexture(DrawTargetSkia* aOwner,
                                    unsigned int aTexture,
                                    const IntSize &aSize,
                                    SurfaceFormat aFormat)
 {
   MOZ_ASSERT(aOwner, "null GrContext");
+#ifdef USE_SKIA_GPU
   GrBackendTextureDesc skiaTexGlue;
   mSize.width = skiaTexGlue.fWidth = aSize.width;
   mSize.height = skiaTexGlue.fHeight = aSize.height;
   skiaTexGlue.fFlags = kNone_GrBackendTextureFlag;
   skiaTexGlue.fOrigin = kBottomLeft_GrSurfaceOrigin;
   skiaTexGlue.fConfig = GfxFormatToGrConfig(aFormat);
   skiaTexGlue.fSampleCnt = 0;
   skiaTexGlue.fTextureHandle = aTexture;
 
   GrTexture *skiaTexture = aOwner->mGrContext->wrapBackendTexture(skiaTexGlue);
   SkImageInfo imgInfo = SkImageInfo::Make(aSize.width, aSize.height, GfxFormatToSkiaColorType(aFormat), kOpaque_SkAlphaType);
   SkGrPixelRef *texRef = new SkGrPixelRef(imgInfo, skiaTexture, false);
   mBitmap.setInfo(imgInfo, aSize.width*aSize.height*4);
   mBitmap.setPixelRef(texRef);
+#endif
 
   mDrawTarget = aOwner;
   return true;
 }
 
 unsigned char*
 SourceSurfaceSkia::GetData()
 {
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -1055,16 +1055,17 @@ bool gfxPlatform::HaveChoiceOfHWAndSWCan
 {
   return mPreferredCanvasBackend == BackendType::SKIA;
 }
 
 void
 gfxPlatform::InitializeSkiaCacheLimits()
 {
   if (UseAcceleratedSkiaCanvas()) {
+#ifdef USE_SKIA_GPU
     bool usingDynamicCache = gfxPrefs::CanvasSkiaGLDynamicCache();
     int cacheItemLimit = gfxPrefs::CanvasSkiaGLCacheItems();
     int cacheSizeLimit = gfxPrefs::CanvasSkiaGLCacheSize();
 
     // Prefs are in megabytes, but we want the sizes in bytes
     cacheSizeLimit *= 1024*1024;
 
     if (usingDynamicCache) {
@@ -1076,17 +1077,16 @@ gfxPlatform::InitializeSkiaCacheLimits()
         cacheSizeLimit = mTotalSystemMemory / 16;
       }
     }
 
   #ifdef DEBUG
     printf_stderr("Determined SkiaGL cache limits: Size %i, Items: %i\n", cacheSizeLimit, cacheItemLimit);
   #endif
 
-#ifdef USE_SKIA_GPU
     mSkiaGlue->GetGrContext()->setResourceCacheLimits(cacheItemLimit, cacheSizeLimit);
 #endif
   }
 }
 
 mozilla::gl::SkiaGLGlue*
 gfxPlatform::GetSkiaGLGlue()
 {