Platform/Engine -> Backend
createPlatform -> wrapBackend

R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6785044

git-svn-id: http://skia.googlecode.com/svn/trunk@6123 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/bench/benchmain.cpp b/bench/benchmain.cpp
index eb8c4ed..6f33952 100644
--- a/bench/benchmain.cpp
+++ b/bench/benchmain.cpp
@@ -203,17 +203,16 @@
         if (!glCtx->init(width, height)) {
             return false;
         }
-        GrPlatform3DContext ctx =
-            reinterpret_cast<GrPlatform3DContext>(glCtx->gl());
-        grCtx = GrContext::Create(kOpenGL_Shaders_GrEngine, ctx);
+        GrBackendContext ctx = reinterpret_cast<GrBackendContext>(glCtx->gl());
+        grCtx = GrContext::Create(kOpenGL_GrBackend, ctx);
         if (NULL != grCtx) {
-            GrPlatformRenderTargetDesc desc;
+            GrBackendRenderTargetDesc desc;
             desc.fConfig = kSkia8888_PM_GrPixelConfig;
             desc.fWidth = width;
             desc.fHeight = height;
             desc.fStencilBits = 8;
             desc.fRenderTargetHandle = glCtx->getFBOID();
-            GrRenderTarget* rt = grCtx->createPlatformRenderTarget(desc);
+            GrRenderTarget* rt = grCtx->wrapBackendRenderTarget(desc);
             if (NULL == rt) {
                 grCtx->unref();
                 return false;
diff --git a/debugger/QT/SkGLWidget.cpp b/debugger/QT/SkGLWidget.cpp
index a9a625a..8b6e857 100644
--- a/debugger/QT/SkGLWidget.cpp
+++ b/debugger/QT/SkGLWidget.cpp
@@ -27,8 +27,9 @@
 
 void SkGLWidget::initializeGL() {
     fCurIntf = GrGLCreateNativeInterface();
-    fCurContext = GrContext::Create(kOpenGL_Shaders_GrEngine, (GrPlatform3DContext) fCurIntf);
-    GrRenderTarget* curRenderTarget = fCurContext->createPlatformRenderTarget(getDesc(this->width(), this->height()));
+    fCurContext = GrContext::Create(kOpenGL_GrBackend, (GrBackendContext) fCurIntf);
+    GrBackendRenderTargetDesc desc = this->getDesc(this->width(), this->height());
+    GrRenderTarget* curRenderTarget = fCurContext->wrapBackendRenderTarget(desc);
     fGpuDevice = new SkGpuDevice(fCurContext, curRenderTarget);
     fCanvas = new SkCanvas(fGpuDevice);
     curRenderTarget->unref();
@@ -39,7 +40,8 @@
 }
 
 void SkGLWidget::resizeGL(int w, int h) {
-    GrRenderTarget* curRenderTarget = fCurContext->createPlatformRenderTarget(getDesc(w,h));
+    GrBackendRenderTargetDesc desc = this->getDesc(w, h);
+    GrRenderTarget* curRenderTarget = fCurContext->wrapBackendRenderTarget(desc);
     SkSafeUnref(fGpuDevice);
     SkSafeUnref(fCanvas);
     fGpuDevice = new SkGpuDevice(fCurContext, curRenderTarget);
@@ -57,8 +59,8 @@
     }
 }
 
-GrPlatformRenderTargetDesc SkGLWidget::getDesc(int w, int h) {
-    GrPlatformRenderTargetDesc desc;
+GrBackendRenderTargetDesc SkGLWidget::getDesc(int w, int h) {
+    GrBackendRenderTargetDesc desc;
     desc.fWidth = SkScalarRound(this->width());
     desc.fHeight = SkScalarRound(this->height());
     desc.fConfig = kSkia8888_PM_GrPixelConfig;
diff --git a/debugger/QT/SkGLWidget.h b/debugger/QT/SkGLWidget.h
index e31d09c..2a60c9a 100644
--- a/debugger/QT/SkGLWidget.h
+++ b/debugger/QT/SkGLWidget.h
@@ -48,7 +48,7 @@
     SkGpuDevice* fGpuDevice;
     SkCanvas* fCanvas;
     SkDebugger* fDebugger;
-    GrPlatformRenderTargetDesc getDesc(int w, int h);
+    GrBackendRenderTargetDesc getDesc(int w, int h);
 };
 
 #endif /* SKGLWIDGET_H_ */
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index dcb5d8b..195f731 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -46,10 +46,9 @@
     SK_DECLARE_INST_COUNT(GrContext)
 
     /**
-     * Creates a GrContext from within a 3D context.
+     * Creates a GrContext for a backend context.
      */
-    static GrContext* Create(GrEngine engine,
-                             GrPlatform3DContext context3D);
+    static GrContext* Create(GrBackend, GrBackendContext);
 
     /**
      * Returns the number of GrContext instances for the current thread.
@@ -290,7 +289,7 @@
     bool isConfigRenderable(GrPixelConfig config) const;
 
     ///////////////////////////////////////////////////////////////////////////
-    // Platform Surfaces
+    // Backend Surfaces
 
     /**
      * Wraps an existing texture with a GrTexture object.
@@ -302,11 +301,11 @@
      *
      * @return GrTexture object or NULL on failure.
      */
-    GrTexture* createPlatformTexture(const GrPlatformTextureDesc& desc);
+    GrTexture* wrapBackendTexture(const GrBackendTextureDesc& desc);
 
     /**
      * Wraps an existing render target with a GrRenderTarget object. It is
-     * similar to createPlatformTexture but can be used to draw into surfaces
+     * similar to wrapBackendTexture but can be used to draw into surfaces
      * that are not also textures (e.g. FBO 0 in OpenGL, or an MSAA buffer that
      * the client will resolve to a texture).
      *
@@ -314,8 +313,7 @@
      *
      * @return GrTexture object or NULL on failure.
      */
-     GrRenderTarget* createPlatformRenderTarget(
-                                    const GrPlatformRenderTargetDesc& desc);
+     GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc);
 
     ///////////////////////////////////////////////////////////////////////////
     // Matrix state
@@ -607,7 +605,7 @@
      * be executed before the resolve.
      *
      * This is only necessary when a client wants to access the object directly
-     * using the underlying graphics API. GrContext will detect when it must
+     * using the backend API directly. GrContext will detect when it must
      * perform a resolve to a GrTexture used as the source of a draw or before
      * reading pixels back from a GrTexture or GrRenderTarget.
      */
@@ -860,6 +858,16 @@
     void printCacheStats() const;
 #endif
 
+    ///////////////////////////////////////////////////////////////////////////
+    // Legacy names that will be kept until WebKit can be updated.
+    GrTexture* createPlatformTexture(const GrPlatformTextureDesc& desc) {
+        return this->wrapBackendTexture(desc);
+    }
+        
+    GrRenderTarget* createPlatformRenderTarget(const GrPlatformRenderTargetDesc& desc) {
+        return wrapBackendRenderTarget(desc);
+    }
+
 private:
     // Used to indicate whether a draw should be performed immediately or queued in fDrawBuffer.
     enum BufferedDraw {
diff --git a/include/gpu/GrContextFactory.h b/include/gpu/GrContextFactory.h
index 600beda..95d02a2 100644
--- a/include/gpu/GrContextFactory.h
+++ b/include/gpu/GrContextFactory.h
@@ -95,9 +95,8 @@
         if (!glCtx.get()->init(kBogusSize, kBogusSize)) {
             return NULL;
         }
-        GrPlatform3DContext p3dctx =
-            reinterpret_cast<GrPlatform3DContext>(glCtx.get()->gl());
-        grCtx.reset(GrContext::Create(kOpenGL_Shaders_GrEngine, p3dctx));
+        GrBackendContext p3dctx = reinterpret_cast<GrBackendContext>(glCtx.get()->gl());
+        grCtx.reset(GrContext::Create(kOpenGL_GrBackend, p3dctx));
         if (!grCtx.get()) {
             return NULL;
         }
diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h
index f3add50..58a3aa5 100644
--- a/include/gpu/GrRenderTarget.h
+++ b/include/gpu/GrRenderTarget.h
@@ -70,7 +70,7 @@
      * If this RT is multisampled, this is the multisample buffer
      * @return the 3D API's handle to this object (e.g. FBO ID in OpenGL)
      */
-    virtual intptr_t getRenderTargetHandle() const = 0;
+    virtual GrBackendObject getRenderTargetHandle() const = 0;
 
     /**
      * If this RT is multisampled, this is the buffer it is resolved to.
@@ -78,7 +78,7 @@
      * (In GL a separate FBO ID is used for the msaa and resolved buffers)
      * @return the 3D API's handle to this object (e.g. FBO ID in OpenGL)
      */
-    virtual intptr_t getRenderTargetResolvedHandle() const = 0;
+    virtual GrBackendObject getRenderTargetResolvedHandle() const = 0;
 
     /**
      * @return true if the surface is multisampled, false otherwise
@@ -94,9 +94,9 @@
      * Call to indicate the multisample contents were modified such that the
      * render target needs to be resolved before it can be used as texture. Gr
      * tracks this for its own drawing and thus this only needs to be called
-     * when the render target has been modified outside of Gr. Only meaningful
-     * for Gr-created RT/Textures and Platform RT/Textures created with the
-     * kGrCanResolve flag.
+     * when the render target has been modified outside of Gr. This has no
+     * effect on wrapped backend render targets.
+     *
      * @param rect  a rect bounding the area needing resolve. NULL indicates
      *              the whole RT needs resolving.
      */
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index f084427..8bd1f2f 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -186,16 +186,15 @@
 /**
  * Possible 3D APIs that may be used by Ganesh.
  */
-enum GrEngine {
-    kOpenGL_Shaders_GrEngine,
-    kOpenGL_Fixed_GrEngine,
+enum GrBackend {
+    kOpenGL_GrBackend,
 };
 
 /**
- * Engine-specific 3D context handle
+ * Backend-specific 3D context handle
  *      GrGLInterface* for OpenGL. If NULL will use the default GL interface.
  */
-typedef intptr_t GrPlatform3DContext;
+typedef intptr_t GrBackendContext;
 
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -595,7 +594,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 // opaque type for 3D API object handles
-typedef intptr_t GrPlatform3DObject;
+typedef intptr_t GrBackendObject;
 
 /**
  * Gr can wrap an existing texture created by the client with a GrTexture
@@ -618,11 +617,11 @@
  * Note: These flags currently form a subset of GrTexture's flags.
  */
 
-enum GrPlatformTextureFlags {
+enum GrBackendTextureFlags {
     /**
      * No flags enabled
      */
-    kNone_GrPlatformTextureFlag              = kNone_GrTextureFlags,
+    kNone_GrBackendTextureFlag             = kNone_GrTextureFlags,
     /**
      * Indicates that the texture is also a render target, and thus should have
      * a GrRenderTarget object.
@@ -630,13 +629,13 @@
      * D3D (future): client must have created the texture with flags that allow
      * it to be used as a render target.
      */
-    kRenderTarget_GrPlatformTextureFlag      = kRenderTarget_GrTextureFlagBit,
+    kRenderTarget_GrBackendTextureFlag     = kRenderTarget_GrTextureFlagBit,
 };
-GR_MAKE_BITFIELD_OPS(GrPlatformTextureFlags)
+GR_MAKE_BITFIELD_OPS(GrBackendTextureFlags)
 
-struct GrPlatformTextureDesc {
-    GrPlatformTextureDesc() { memset(this, 0, sizeof(*this)); }
-    GrPlatformTextureFlags          fFlags;
+struct GrBackendTextureDesc {
+    GrBackendTextureDesc() { memset(this, 0, sizeof(*this)); }
+    GrBackendTextureFlags           fFlags;
     int                             fWidth;         //<! width in pixels
     int                             fHeight;        //<! height in pixels
     GrPixelConfig                   fConfig;        //<! color format
@@ -649,7 +648,7 @@
      * Handle to the 3D API object.
      * OpenGL: Texture ID.
      */
-    GrPlatform3DObject              fTextureHandle;
+    GrBackendObject                 fTextureHandle;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -664,14 +663,14 @@
  * the 3D API doesn't require this (OpenGL).
  */
 
-struct GrPlatformRenderTargetDesc {
-    GrPlatformRenderTargetDesc() { memset(this, 0, sizeof(*this)); }
+struct GrBackendRenderTargetDesc {
+    GrBackendRenderTargetDesc() { memset(this, 0, sizeof(*this)); }
     int                             fWidth;         //<! width in pixels
     int                             fHeight;        //<! height in pixels
     GrPixelConfig                   fConfig;        //<! color format
     /**
      * The number of samples per pixel. Gr uses this to influence decisions
-     * about applying other forms of antialiasing.
+     * about applying other forms of anti-aliasing.
      */
     int                             fSampleCnt;
     /**
@@ -682,9 +681,26 @@
      * Handle to the 3D API object.
      * OpenGL: FBO ID
      */
-    GrPlatform3DObject              fRenderTargetHandle;
+    GrBackendObject                 fRenderTargetHandle;
 };
 
+///////////////////////////////////////////////////////////////////////////////
+// Legacy names that will be kept until WebKit can be updated.
+
+typedef GrBackend GrEngine;
+static const GrBackend kOpenGL_Shaders_GrEngine = kOpenGL_GrBackend;
+
+typedef GrBackendContext GrPlatform3DContext;
+
+typedef GrBackendObject GrPlatform3DObject;
+
+typedef GrBackendTextureFlags GrPlatformTextureFlags;
+static const GrBackendTextureFlags kNone_GrPlatformTextureFlag = kNone_GrBackendTextureFlag;
+static const GrBackendTextureFlags kRenderTarget_GrPlatformTextureFlag = kRenderTarget_GrBackendTextureFlag;
+
+typedef GrBackendTextureDesc GrPlatformTextureDesc;
+
+typedef GrBackendRenderTargetDesc GrPlatformRenderTargetDesc;
 
 ///////////////////////////////////////////////////////////////////////////////
 
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index df77063..5ff1b4e 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -226,8 +226,7 @@
         }
 
         SkASSERT(NULL == fCurContext);
-        fCurContext = GrContext::Create(kOpenGL_Shaders_GrEngine,
-                                        (GrPlatform3DContext) fCurIntf);
+        fCurContext = GrContext::Create(kOpenGL_GrBackend, (GrBackendContext) fCurIntf);
 
         if (NULL == fCurContext || NULL == fCurIntf) {
             // We need some context and interface to see results
@@ -315,7 +314,7 @@
         if (fCurContext) {
             win->attach(fBackend, fMSAASampleCount);
 
-            GrPlatformRenderTargetDesc desc;
+            GrBackendRenderTargetDesc desc;
             desc.fWidth = SkScalarRound(win->width());
             desc.fHeight = SkScalarRound(win->height());
             desc.fConfig = kSkia8888_PM_GrPixelConfig;
@@ -326,7 +325,7 @@
             desc.fRenderTargetHandle = buffer;
 
             SkSafeUnref(fCurRenderTarget);
-            fCurRenderTarget = fCurContext->createPlatformRenderTarget(desc);
+            fCurRenderTarget = fCurContext->wrapBackendRenderTarget(desc);
         }
 #endif
     }
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 858242b..23583dd 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -59,10 +59,9 @@
 
 #define ASSERT_OWNED_RESOURCE(R) GrAssert(!(R) || (R)->getContext() == this)
 
-GrContext* GrContext::Create(GrEngine engine,
-                             GrPlatform3DContext context3D) {
+GrContext* GrContext::Create(GrBackend backend, GrBackendContext context) {
     GrContext* ctx = NULL;
-    GrGpu* fGpu = GrGpu::Create(engine, context3D);
+    GrGpu* fGpu = GrGpu::Create(backend, context);
     if (NULL != fGpu) {
         ctx = SkNEW_ARGS(GrContext, (fGpu));
         fGpu->unref();
@@ -531,12 +530,12 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-GrTexture* GrContext::createPlatformTexture(const GrPlatformTextureDesc& desc) {
-    return fGpu->createPlatformTexture(desc);
+GrTexture* GrContext::wrapBackendTexture(const GrBackendTextureDesc& desc) {
+    return fGpu->wrapBackendTexture(desc);
 }
 
-GrRenderTarget* GrContext::createPlatformRenderTarget(const GrPlatformRenderTargetDesc& desc) {
-    return fGpu->createPlatformRenderTarget(desc);
+GrRenderTarget* GrContext::wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc) {
+    return fGpu->wrapBackendRenderTarget(desc);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 4bc1574..542c458 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -173,9 +173,9 @@
     }
 }
 
-GrTexture* GrGpu::createPlatformTexture(const GrPlatformTextureDesc& desc) {
+GrTexture* GrGpu::wrapBackendTexture(const GrBackendTextureDesc& desc) {
     this->handleDirtyContext();
-    GrTexture* tex = this->onCreatePlatformTexture(desc);
+    GrTexture* tex = this->onWrapBackendTexture(desc);
     if (NULL == tex) {
         return NULL;
     }
@@ -190,9 +190,9 @@
     }
 }
 
-GrRenderTarget* GrGpu::createPlatformRenderTarget(const GrPlatformRenderTargetDesc& desc) {
+GrRenderTarget* GrGpu::wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc) {
     this->handleDirtyContext();
-    return this->onCreatePlatformRenderTarget(desc);
+    return this->onWrapBackendRenderTarget(desc);
 }
 
 GrVertexBuffer* GrGpu::createVertexBuffer(uint32_t size, bool dynamic) {
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 60e49e7..a4ed0ed 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -29,7 +29,7 @@
 public:
 
     /**
-     * Additional blend coeffecients for dual source blending, not exposed
+     * Additional blend coefficients for dual source blending, not exposed
      * through GrPaint/GrContext.
      */
     enum ExtendedBlendCoeffs {
@@ -44,11 +44,10 @@
     };
 
     /**
-     *  Create an instance of GrGpu that matches the specified Engine backend.
-     *  If the requested engine is not supported (at compile-time or run-time)
-     *  this returns NULL.
+     * Create an instance of GrGpu that matches the specified backend. If the requested backend is
+     * not supported (at compile-time or run-time) this returns NULL.
      */
-    static GrGpu* Create(GrEngine, GrPlatform3DContext context3D);
+    static GrGpu* Create(GrBackend, GrBackendContext);
 
     ////////////////////////////////////////////////////////////////////////////
 
@@ -96,14 +95,14 @@
                              const void* srcData, size_t rowBytes);
 
     /**
-     * Implements GrContext::createPlatformTexture
+     * Implements GrContext::wrapBackendTexture
      */
-    GrTexture* createPlatformTexture(const GrPlatformTextureDesc& desc);
+    GrTexture* wrapBackendTexture(const GrBackendTextureDesc&);
 
     /**
-     * Implements GrContext::createPlatformTexture
+     * Implements GrContext::wrapBackendTexture
      */
-    GrRenderTarget* createPlatformRenderTarget(const GrPlatformRenderTargetDesc& desc);
+    GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc&);
 
     /**
      * Creates a vertex buffer.
@@ -245,7 +244,7 @@
      * @param height        height of rectangle to write in pixels.
      * @param config        the pixel config of the source buffer
      * @param buffer        memory to read pixels from
-     * @param rowBytes      number of bytes bewtween consecutive rows. Zero
+     * @param rowBytes      number of bytes between consecutive rows. Zero
      *                      means rows are tightly packed.
      */
     void writeTexturePixels(GrTexture* texture,
@@ -443,23 +442,23 @@
     virtual void onResetContext() = 0;
 
 
-    // overridden by API-specific derived class to create objects.
+    // overridden by backend-specific derived class to create objects.
     virtual GrTexture* onCreateTexture(const GrTextureDesc& desc,
                                        const void* srcData,
                                        size_t rowBytes) = 0;
-    virtual GrTexture* onCreatePlatformTexture(const GrPlatformTextureDesc& desc) = 0;
-    virtual GrRenderTarget* onCreatePlatformRenderTarget(const GrPlatformRenderTargetDesc& desc) = 0;
+    virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) = 0;
+    virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&) = 0;
     virtual GrVertexBuffer* onCreateVertexBuffer(uint32_t size,
                                                  bool dynamic) = 0;
     virtual GrIndexBuffer* onCreateIndexBuffer(uint32_t size,
                                                bool dynamic) = 0;
     virtual GrPath* onCreatePath(const SkPath& path) = 0;
 
-    // overridden by API-specific derivated class to perform the clear and
+    // overridden by backend-specific derived class to perform the clear and
     // clearRect. NULL rect means clear whole target.
     virtual void onClear(const GrIRect* rect, GrColor color) = 0;
 
-    // overridden by API-specific derived class to perform the draw call.
+    // overridden by backend-specific derived class to perform the draw call.
     virtual void onGpuDrawIndexed(GrPrimitiveType type,
                                   uint32_t startVertex,
                                   uint32_t startIndex,
@@ -476,13 +475,13 @@
     virtual void setStencilPathSettings(const GrPath&,
                                         GrPathFill,
                                         GrStencilSettings* settings) = 0;
-    // overridden by API-specific derived class to perform the path stenciling.
+    // overridden by backend-specific derived class to perform the path stenciling.
     virtual void onGpuStencilPath(const GrPath*, GrPathFill) = 0;
 
-    // overridden by API-specific derived class to perform flush
+    // overridden by backend-specific derived class to perform flush
     virtual void onForceRenderTargetFlush() = 0;
 
-    // overridden by API-specific derived class to perform the read pixels.
+    // overridden by backend-specific derived class to perform the read pixels.
     virtual bool onReadPixels(GrRenderTarget* target,
                               int left, int top, int width, int height,
                               GrPixelConfig,
@@ -490,13 +489,13 @@
                               size_t rowBytes,
                               bool invertY) = 0;
 
-    // overridden by API-specific derived class to perform the texture update
+    // overridden by backend-specific derived class to perform the texture update
     virtual void onWriteTexturePixels(GrTexture* texture,
                                       int left, int top, int width, int height,
                                       GrPixelConfig config, const void* buffer,
                                       size_t rowBytes) = 0;
 
-    // overridden by API-specific derived class to perform the resolve
+    // overridden by backend-specific derived class to perform the resolve
     virtual void onResolveRenderTarget(GrRenderTarget* target) = 0;
 
     // called to program the vertex data, indexCount will be 0 if drawing non-
@@ -520,7 +519,7 @@
 
     // The GrGpu typically records the clients requested state and then flushes
     // deltas from previous state at draw time. This function does the
-    // API-specific flush of the state
+    // backend-specific flush of the state
     // returns false if current state is unsupported.
     virtual bool flushGraphicsState(DrawType) = 0;
 
diff --git a/src/gpu/GrGpuFactory.cpp b/src/gpu/GrGpuFactory.cpp
index 0d4c381..63a73b7 100644
--- a/src/gpu/GrGpuFactory.cpp
+++ b/src/gpu/GrGpuFactory.cpp
@@ -14,13 +14,13 @@
 #include "GrGpu.h"
 #include "gl/GrGpuGL.h"
 
-GrGpu* GrGpu::Create(GrEngine engine, GrPlatform3DContext context3D) {
+GrGpu* GrGpu::Create(GrBackend backend, GrBackendContext context) {
 
     const GrGLInterface* glInterface = NULL;
     SkAutoTUnref<const GrGLInterface> glInterfaceUnref;
 
-    if (kOpenGL_Shaders_GrEngine == engine) {
-        glInterface = reinterpret_cast<const GrGLInterface*>(context3D);
+    if (kOpenGL_GrBackend == backend) {
+        glInterface = reinterpret_cast<const GrGLInterface*>(context);
         if (NULL == glInterface) {
             glInterface = GrGLDefaultInterface();
             // By calling GrGLDefaultInterface we've taken a ref on the
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 7a58c53..62652f8 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -476,13 +476,13 @@
     fHWConstAttribCoverage = GrColor_ILLEGAL;
 }
 
-GrTexture* GrGpuGL::onCreatePlatformTexture(const GrPlatformTextureDesc& desc) {
+GrTexture* GrGpuGL::onWrapBackendTexture(const GrBackendTextureDesc& desc) {
     GrGLTexture::Desc glTexDesc;
-    if (!configToGLFormats(desc.fConfig, false, NULL, NULL, NULL)) {
+    if (!this->configToGLFormats(desc.fConfig, false, NULL, NULL, NULL)) {
         return NULL;
     }
 
-    // next line relies on PlatformTextureDesc's flags matching GrTexture's
+    // next line relies on GrBackendTextureDesc's flags matching GrTexture's
     glTexDesc.fFlags = (GrTextureFlags) desc.fFlags;
     glTexDesc.fWidth = desc.fWidth;
     glTexDesc.fHeight = desc.fHeight;
@@ -493,7 +493,7 @@
     glTexDesc.fOrientation = GrGLTexture::kBottomUp_Orientation;
 
     GrGLTexture* texture = NULL;
-    if (desc.fFlags & kRenderTarget_GrPlatformTextureFlag) {
+    if (desc.fFlags & kRenderTarget_GrBackendTextureFlag) {
         GrGLRenderTarget::Desc glRTDesc;
         glRTDesc.fRTFBOID = 0;
         glRTDesc.fTexFBOID = 0;
@@ -519,7 +519,7 @@
     return texture;
 }
 
-GrRenderTarget* GrGpuGL::onCreatePlatformRenderTarget(const GrPlatformRenderTargetDesc& desc) {
+GrRenderTarget* GrGpuGL::onWrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc) {
     GrGLRenderTarget::Desc glDesc;
     glDesc.fConfig = desc.fConfig;
     glDesc.fRTFBOID = static_cast<GrGLuint>(desc.fRenderTargetHandle);
diff --git a/src/gpu/gl/GrGpuGL.h b/src/gpu/gl/GrGpuGL.h
index 0cd7eb5..0f7b816 100644
--- a/src/gpu/gl/GrGpuGL.h
+++ b/src/gpu/gl/GrGpuGL.h
@@ -66,10 +66,8 @@
     virtual GrIndexBuffer* onCreateIndexBuffer(uint32_t size,
                                                bool dynamic) SK_OVERRIDE;
     virtual GrPath* onCreatePath(const SkPath&) SK_OVERRIDE;
-    virtual GrTexture* onCreatePlatformTexture(
-        const GrPlatformTextureDesc& desc) SK_OVERRIDE;
-    virtual GrRenderTarget* onCreatePlatformRenderTarget(
-        const GrPlatformRenderTargetDesc& desc) SK_OVERRIDE;
+    virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) SK_OVERRIDE;
+    virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&) SK_OVERRIDE;
     virtual bool createStencilBufferForRenderTarget(GrRenderTarget* rt,
                                                     int width,
                                                     int height) SK_OVERRIDE;
diff --git a/tests/Test.cpp b/tests/Test.cpp
index deb8348..07107bc 100644
--- a/tests/Test.cpp
+++ b/tests/Test.cpp
@@ -93,8 +93,8 @@
     if (NULL == gGrContext.get()) {
         gGLContext.init();
         if (gGLContext.get()->init(800, 600)) {
-            GrPlatform3DContext ctx = reinterpret_cast<GrPlatform3DContext>(gGLContext.get()->gl());
-            gGrContext.reset(GrContext::Create(kOpenGL_Shaders_GrEngine, ctx));
+            GrBackendContext ctx = reinterpret_cast<GrBackendContext>(gGLContext.get()->gl());
+            gGrContext.reset(GrContext::Create(kOpenGL_GrBackend, ctx));
         }
     }
     if (gGLContext.get()) {