Bug 1004376 - Remove reliance on legacy skia apis GETTOTALCLIP. r=gw280
authorWalter Litwinczyk <wlitwinczyk@mozilla.com>
Fri, 20 Jun 2014 11:03:09 -0700
changeset 190257 69d293514ef3bad6c38cff191ca27e0e13b75e5f
parent 190256 4881d7aaa67cb7401bc16260a37b65e98a636f9a
child 190258 57d65c06db19df44514f5b848f9cb557b325a0c1
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersgw280
bugs1004376
milestone33.0a1
Bug 1004376 - Remove reliance on legacy skia apis GETTOTALCLIP. r=gw280
gfx/skia/trunk/include/config/SkUserConfig.h
other-licenses/skia-npapi/ANPCanvas.cpp
--- a/gfx/skia/trunk/include/config/SkUserConfig.h
+++ b/gfx/skia/trunk/include/config/SkUserConfig.h
@@ -202,9 +202,8 @@
 #    define SK_MUTEX_PLATFORM_H "skia/SkMutex_pthread.h"
 #  endif
 #endif
 
 #define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 0
 
 #define SK_SUPPORT_LEGACY_LAYERRASTERIZER_API 1
 #define SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG 1
-#define SK_SUPPORT_LEGACY_GETTOTALCLIP 1
--- a/other-licenses/skia-npapi/ANPCanvas.cpp
+++ b/other-licenses/skia-npapi/ANPCanvas.cpp
@@ -20,16 +20,17 @@
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 // must include config.h first for webkit to fiddle with new/delete
 #include "SkANP.h"
+#include "SkRect.h"
 
 static ANPCanvas* anp_newCanvas(const ANPBitmap* bitmap) {
     SkBitmap bm;
     return new ANPCanvas(*SkANP::SetBitmap(&bm, *bitmap));
 }
 
 static void anp_deleteCanvas(ANPCanvas* canvas) {
     delete canvas;
@@ -82,19 +83,19 @@ static bool anp_getLocalClipBounds(ANPCa
     if (canvas->skcanvas->getClipBounds(&bounds)) {
         SkANP::SetRect(r, bounds);
         return true;
     }
     return false;
 }
 
 static bool anp_getDeviceClipBounds(ANPCanvas* canvas, ANPRectI* r) {
-    const SkRegion& clip = canvas->skcanvas->getTotalClip();
-    if (!clip.isEmpty()) {
-        SkANP::SetRect(r, clip.getBounds());
+    SkIRect bounds;
+    if (canvas->skcanvas->getClipDeviceBounds(&bounds)) {
+        SkANP::SetRect(r, bounds);
         return true;
     }
     return false;
 }
 
 static void anp_drawColor(ANPCanvas* canvas, ANPColor color) {
     canvas->skcanvas->drawColor(color);
 }