Bug 915145 - Always use soft clipping with Skia r=snorp
authorGeorge Wright <gwright@mozilla.com>
Tue, 08 Oct 2013 15:05:57 -0400
changeset 150110 4b21fe65487a8f8f38a883bb0af78f80e1f49351
parent 150109 04c327ab2215bcc14895d8f27a03eb596ac439a5
child 150111 657aa2568bc2ea0cc586b64f897f43dca93412b8
push id34751
push usergwright@mozilla.com
push dateTue, 08 Oct 2013 19:21:02 +0000
treeherdermozilla-inbound@4b21fe65487a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs915145
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 915145 - Always use soft clipping with Skia r=snorp
gfx/2d/DrawTargetSkia.cpp
gfx/2d/DrawTargetSkia.h
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
@@ -126,21 +126,16 @@ RemoveGLDrawTarget(DrawTargetSkia* targe
   }
 }
 
 #endif
 
 DrawTargetSkia::DrawTargetSkia()
   : mSnapshot(nullptr)
 {
-#ifdef ANDROID
-  mSoftClipping = false;
-#else
-  mSoftClipping = true;
-#endif
 }
 
 DrawTargetSkia::~DrawTargetSkia()
 {
 #ifdef USE_SKIA_GPU
   RemoveGLDrawTarget(this);
 #endif
 }
@@ -702,19 +697,16 @@ DrawTargetSkia::InitWithGLContextAndGrGL
                                                   GrGLInterface* aGrGLInterface,
                                                   const IntSize &aSize,
                                                   SurfaceFormat aFormat)
 {
   mGLContext = aGLContext;
   mSize = aSize;
   mFormat = aFormat;
 
-  // Always use soft clipping when we're using GL
-  mSoftClipping = true;
-
   mGrGLInterface = aGrGLInterface;
   mGrGLInterface->fCallbackData = reinterpret_cast<GrGLInterfaceCallbackData>(this);
 
   GrBackendContext backendContext = reinterpret_cast<GrBackendContext>(aGrGLInterface);
   SkAutoTUnref<GrContext> gr(GrContext::Create(kOpenGL_GrBackend, backendContext));
   mGrContext = gr.get();
 
   GrBackendRenderTargetDesc targetDescriptor;
@@ -786,42 +778,42 @@ DrawTargetSkia::CreatePathBuilder(FillRu
 }
 
 void
 DrawTargetSkia::ClearRect(const Rect &aRect)
 {
   MarkChanged();
   SkPaint paint;
   mCanvas->save();
-  mCanvas->clipRect(RectToSkRect(aRect), SkRegion::kIntersect_Op, mSoftClipping);
+  mCanvas->clipRect(RectToSkRect(aRect), SkRegion::kIntersect_Op, true);
   paint.setColor(SkColorSetARGB(0, 0, 0, 0));
   paint.setXfermodeMode(SkXfermode::kSrc_Mode);
   mCanvas->drawPaint(paint);
   mCanvas->restore();
 }
 
 void
 DrawTargetSkia::PushClip(const Path *aPath)
 {
   if (aPath->GetBackendType() != BACKEND_SKIA) {
     return;
   }
 
   const PathSkia *skiaPath = static_cast<const PathSkia*>(aPath);
   mCanvas->save(SkCanvas::kClip_SaveFlag);
-  mCanvas->clipPath(skiaPath->GetPath(), SkRegion::kIntersect_Op, mSoftClipping);
+  mCanvas->clipPath(skiaPath->GetPath(), SkRegion::kIntersect_Op, true);
 }
 
 void
 DrawTargetSkia::PushClipRect(const Rect& aRect)
 {
   SkRect rect = RectToSkRect(aRect);
 
   mCanvas->save(SkCanvas::kClip_SaveFlag);
-  mCanvas->clipRect(rect, SkRegion::kIntersect_Op, mSoftClipping);
+  mCanvas->clipRect(rect, SkRegion::kIntersect_Op, true);
 }
 
 void
 DrawTargetSkia::PopClip()
 {
   mCanvas->restore();
 }
 
--- a/gfx/2d/DrawTargetSkia.h
+++ b/gfx/2d/DrawTargetSkia.h
@@ -130,13 +130,12 @@ private:
   RefPtr<GenericRefCountedBase> mGLContext;
   SkRefPtr<GrGLInterface> mGrGLInterface;
   SkRefPtr<GrContext> mGrContext;
 #endif
 
   IntSize mSize;
   SkRefPtr<SkCanvas> mCanvas;
   SourceSurfaceSkia* mSnapshot;
-  bool mSoftClipping;
 };
 
 }
 }