[go: nahoru, domu]

Merge third_party/skia/include from https://chromium.googlesource.com/external/skia/include.git at 64e9132cb62ab9699457c0cbec7a4aee0f2a660b

This commit was generated by merge_from_chromium.py.

Change-Id: I076eaf0c0eb2136c08316a54c3cb44c555ef7c8d
diff --git a/core/SkImage.h b/core/SkImage.h
index c85a2bf..871d461 100644
--- a/core/SkImage.h
+++ b/core/SkImage.h
@@ -65,7 +65,13 @@
     static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowBytes);
     static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes);
     static SkImage* NewEncodedData(SkData*);
-    static SkImage* NewTexture(GrTexture*);
+
+    /**
+     * GrTexture is a more logical parameter for this factory, but its
+     * interactions with scratch cache still has issues, so for now we take
+     * SkBitmap instead. This will be changed in the future. skbug.com/1449
+     */
+    static SkImage* NewTexture(const SkBitmap&);
 
     int width() const { return fWidth; }
     int height() const { return fHeight; }
diff --git a/core/SkImageFilter.h b/core/SkImageFilter.h
index e467761..54de288 100644
--- a/core/SkImageFilter.h
+++ b/core/SkImageFilter.h
@@ -91,9 +91,10 @@
      *  caller to unref it.
      *
      *  The effect can assume its vertexCoords space maps 1-to-1 with texels
-     *  in the texture.
+     *  in the texture.  "offset" is the delta between the source and
+     *  destination rect's origins, when cropped processing is being performed.
      */
-    virtual bool asNewEffect(GrEffectRef** effect, GrTexture*) const;
+    virtual bool asNewEffect(GrEffectRef** effect, GrTexture*, const SkIPoint& offset) const;
 
     /**
      *  Returns true if the filter can be processed on the GPU.  This is most
diff --git a/effects/SkLightingImageFilter.h b/effects/SkLightingImageFilter.h
index 5e9028d..07f713b 100644
--- a/effects/SkLightingImageFilter.h
+++ b/effects/SkLightingImageFilter.h
@@ -51,30 +51,33 @@
 public:
     static SkImageFilter* CreateDistantLitDiffuse(const SkPoint3& direction,
         SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
-        SkImageFilter* input = NULL);
+        SkImageFilter* input = NULL, const SkIRect* cropRect = NULL);
     static SkImageFilter* CreatePointLitDiffuse(const SkPoint3& location,
         SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
-        SkImageFilter* input = NULL);
+        SkImageFilter* input = NULL, const SkIRect* cropRect = NULL);
     static SkImageFilter* CreateSpotLitDiffuse(const SkPoint3& location,
         const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle,
         SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
-        SkImageFilter* input = NULL);
+        SkImageFilter* input = NULL, const SkIRect* cropRect = NULL);
     static SkImageFilter* CreateDistantLitSpecular(const SkPoint3& direction,
         SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
-        SkScalar shininess, SkImageFilter* input = NULL);
+        SkScalar shininess, SkImageFilter* input = NULL, const SkIRect* cropRect = NULL);
     static SkImageFilter* CreatePointLitSpecular(const SkPoint3& location,
         SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
-        SkScalar shininess, SkImageFilter* input = NULL);
+        SkScalar shininess, SkImageFilter* input = NULL, const SkIRect* cropRect = NULL);
     static SkImageFilter* CreateSpotLitSpecular(const SkPoint3& location,
         const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle,
         SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
-        SkScalar shininess, SkImageFilter* input = NULL);
+        SkScalar shininess, SkImageFilter* input = NULL, const SkIRect* cropRect = NULL);
     ~SkLightingImageFilter();
 
     SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
 
 protected:
-    SkLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkImageFilter* input);
+    SkLightingImageFilter(SkLight* light,
+                          SkScalar surfaceScale,
+                          SkImageFilter* input,
+                          const SkIRect* cropRect = NULL);
     explicit SkLightingImageFilter(SkFlattenableReadBuffer& buffer);
     virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
     const SkLight* light() const { return fLight; }
diff --git a/effects/SkMagnifierImageFilter.h b/effects/SkMagnifierImageFilter.h
index 80e3af6..b5cbd74 100644
--- a/effects/SkMagnifierImageFilter.h
+++ b/effects/SkMagnifierImageFilter.h
@@ -17,7 +17,7 @@
     SkMagnifierImageFilter(SkRect srcRect, SkScalar inset);
 
 #if SK_SUPPORT_GPU
-    virtual bool asNewEffect(GrEffectRef** effect, GrTexture* texture) const SK_OVERRIDE;
+    virtual bool asNewEffect(GrEffectRef** effect, GrTexture* texture, const SkIPoint& offset) const SK_OVERRIDE;
 #endif
 
     SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter)
diff --git a/effects/SkMatrixConvolutionImageFilter.h b/effects/SkMatrixConvolutionImageFilter.h
index 78a66f8..71c8938 100644
--- a/effects/SkMatrixConvolutionImageFilter.h
+++ b/effects/SkMatrixConvolutionImageFilter.h
@@ -62,7 +62,7 @@
                                SkBitmap* result, SkIPoint* loc) SK_OVERRIDE;
 
 #if SK_SUPPORT_GPU
-    virtual bool asNewEffect(GrEffectRef** effect, GrTexture*) const SK_OVERRIDE;
+    virtual bool asNewEffect(GrEffectRef** effect, GrTexture*, const SkIPoint& offset) const SK_OVERRIDE;
 #endif
 
 private:
diff --git a/gpu/GrContext.h b/gpu/GrContext.h
index e955cac..ced251b 100644
--- a/gpu/GrContext.h
+++ b/gpu/GrContext.h
@@ -254,7 +254,7 @@
     int getMaxTextureSize() const;
 
     /**
-     *  Temporarily override the true max texture size. Note: an override 
+     *  Temporarily override the true max texture size. Note: an override
      *  larger then the true max texture size will have no effect.
      *  This entry point is mainly meant for testing texture size dependent
      *  features and is only available if defined outside of Skia (see
@@ -882,7 +882,7 @@
 
     SkTDArray<CleanUpData>          fCleanUpData;
 
-    int                             fMaxTextureSizeOverride;  
+    int                             fMaxTextureSizeOverride;
 
     GrContext(); // init must be called after the constructor.
     bool init(GrBackend, GrBackendContext);
diff --git a/gpu/GrTexture.h b/gpu/GrTexture.h
index a870818..1fb575c 100644
--- a/gpu/GrTexture.h
+++ b/gpu/GrTexture.h
@@ -44,6 +44,14 @@
         return 0 != (fDesc.fFlags & flags);
     }
 
+    void dirtyMipMaps(bool mipMapsDirty) {
+        fMipMapsDirty = mipMapsDirty;
+    }
+
+    bool mipMapsAreDirty() const {
+        return fMipMapsDirty;
+    }
+
     /**
      *  Approximate number of bytes used by the texture
      */
@@ -136,7 +144,8 @@
 
     GrTexture(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc)
     : INHERITED(gpu, isWrapped, desc)
-    , fRenderTarget(NULL) {
+    , fRenderTarget(NULL)
+    , fMipMapsDirty(true) {
 
         // only make sense if alloc size is pow2
         fShiftFixedX = 31 - SkCLZ(fDesc.fWidth);
@@ -156,6 +165,8 @@
     int                 fShiftFixedX;
     int                 fShiftFixedY;
 
+    bool                fMipMapsDirty;
+
     virtual void internal_dispose() const SK_OVERRIDE;
 
     typedef GrSurface INHERITED;
diff --git a/gpu/GrTextureAccess.h b/gpu/GrTextureAccess.h
index 20dc57d..8100b7a 100644
--- a/gpu/GrTextureAccess.h
+++ b/gpu/GrTextureAccess.h
@@ -25,7 +25,7 @@
     GrTextureParams() {
         this->reset();
     }
-    
+
     enum FilterMode {
         kNone_FilterMode,
         kBilerp_FilterMode,
diff --git a/gpu/gl/GrGLFunctions.h b/gpu/gl/GrGLFunctions.h
index c29c14f..b30ef3a 100644
--- a/gpu/gl/GrGLFunctions.h
+++ b/gpu/gl/GrGLFunctions.h
@@ -94,6 +94,7 @@
     typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLFrontFaceProc)(GrGLenum mode);
     typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGenBuffersProc)(GrGLsizei n, GrGLuint* buffers);
     typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGenFramebuffersProc)(GrGLsizei n, GrGLuint *framebuffers);
+    typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGenerateMipmapProc)(GrGLenum target);
     typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGenQueriesProc)(GrGLsizei n, GrGLuint *ids);
     typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGenRenderbuffersProc)(GrGLsizei n, GrGLuint *renderbuffers);
     typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGenTexturesProc)(GrGLsizei n, GrGLuint* textures);
diff --git a/gpu/gl/GrGLInterface.h b/gpu/gl/GrGLInterface.h
index 6cc8e17..6a51adc 100644
--- a/gpu/gl/GrGLInterface.h
+++ b/gpu/gl/GrGLInterface.h
@@ -189,6 +189,7 @@
     GLPtr<GrGLFrontFaceProc> fFrontFace;
     GLPtr<GrGLGenBuffersProc> fGenBuffers;
     GLPtr<GrGLGenFramebuffersProc> fGenFramebuffers;
+    GLPtr<GrGLGenerateMipmapProc> fGenerateMipmap;
     GLPtr<GrGLGenQueriesProc> fGenQueries;
     GLPtr<GrGLGenRenderbuffersProc> fGenRenderbuffers;
     GLPtr<GrGLGenTexturesProc> fGenTextures;