Skip to content

Commit

Permalink
Bug 1249640: Part 1 A way to block canvas 2D acceleration from blockl…
Browse files Browse the repository at this point in the history
…ists. r=benwa
  • Loading branch information
Milan Sreckovic committed Feb 19, 2016
1 parent 6bb0bc3 commit 536d058
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,5 +285,20 @@
<driverVersionComparator> BETWEEN_INCLUSIVE_START </driverVersionComparator>
</gfxBlacklistEntry>

<gfxBlacklistEntry>
<os>All</os>
<vendor>0xdcdc</vendor>
<devices>
<device>0x2783</device>
<device>0x1234</device>
<device>0x2782</device>
</devices>
<feature> CANVAS2D_ACCELERATION </feature>
<featureStatus> BLOCKED_DRIVER_VERSION </featureStatus>
<driverVersion> 8.52.322.1000 </driverVersion>
<driverVersionMax> 9.52.322.1000 </driverVersionMax>
<driverVersionComparator> BETWEEN_EXCLUSIVE </driverVersionComparator>
</gfxBlacklistEntry>

</gfxItems>
</blocklist>
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ function run_test() {
status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_DIRECT3D_9_LAYERS);
do_check_eq(status, Ci.nsIGfxInfo.FEATURE_STATUS_OK);

status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_CANVAS2D_ACCELERATION);
do_check_eq(status, Ci.nsIGfxInfo.FEATURE_STATUS_OK);

gTestserver.stop(do_test_finished);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ function run_test() {
status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_WEBGL_ANGLE);
do_check_eq(status, Ci.nsIGfxInfo.FEATURE_STATUS_OK);

status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_CANVAS2D_ACCELERATION);
do_check_eq(status, Ci.nsIGfxInfo.FEATURE_BLOCKED_DRIVER_VERSION);

gTestserver.stop(do_test_finished);
}

Expand Down
5 changes: 5 additions & 0 deletions widget/GfxInfoBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ GetPrefNameForFeature(int32_t aFeature)
case nsIGfxInfo::FEATURE_WEBRTC_HW_ACCELERATION_DECODE:
name = BLACKLIST_PREF_BRANCH "webrtc.hw.acceleration.decode";
break;
case nsIGfxInfo::FEATURE_CANVAS2D_ACCELERATION:
name = BLACKLIST_PREF_BRANCH "canvas2d.acceleration";
default:
break;
}
Expand Down Expand Up @@ -350,6 +352,8 @@ BlacklistFeatureToGfxFeature(const nsAString& aFeature)
return nsIGfxInfo::FEATURE_WEBRTC_HW_ACCELERATION_DECODE;
else if (aFeature.EqualsLiteral("WEBRTC_HW_ACCELERATION"))
return nsIGfxInfo::FEATURE_WEBRTC_HW_ACCELERATION;
else if (aFeature.EqualsLiteral("CANVAS2D_ACCELERATION"))
return nsIGfxInfo::FEATURE_CANVAS2D_ACCELERATION;

// If we don't recognize the feature, it may be new, and something
// this version doesn't understand. So, nothing to do. This is
Expand Down Expand Up @@ -995,6 +999,7 @@ GfxInfoBase::EvaluateDownloadedBlacklist(nsTArray<GfxDriverInfo>& aDriverInfo)
nsIGfxInfo::FEATURE_WEBGL_MSAA,
nsIGfxInfo::FEATURE_STAGEFRIGHT,
nsIGfxInfo::FEATURE_WEBRTC_HW_ACCELERATION,
nsIGfxInfo::FEATURE_CANVAS2D_ACCELERATION,
0
};

Expand Down
2 changes: 2 additions & 0 deletions widget/nsIGfxInfo.idl
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ interface nsIGfxInfo : nsISupports
const long FEATURE_WEBRTC_HW_ACCELERATION_ENCODE = 14;
/* Whether Webrtc Hardware acceleration is supported, starting in 42. */
const long FEATURE_WEBRTC_HW_ACCELERATION_DECODE = 15;
/* Whether Canvas acceleration is supported, starting in 45 */
const long FEATURE_CANVAS2D_ACCELERATION = 16;

/*
* A set of return values from GetFeatureStatus
Expand Down

0 comments on commit 536d058

Please sign in to comment.