gfx/skia/trunk/src/image/SkImage_Base.h

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 /*
     2  * Copyright 2012 Google Inc.
     3  *
     4  * Use of this source code is governed by a BSD-style license that can be
     5  * found in the LICENSE file.
     6  */
     8 #ifndef SkImage_Base_DEFINED
     9 #define SkImage_Base_DEFINED
    11 #include "SkImage.h"
    13 class SkImage_Base : public SkImage {
    14 public:
    15     SkImage_Base(int width, int height) : INHERITED(width, height) {}
    17     virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) = 0;
    18     virtual void onDrawRectToRect(SkCanvas*, const SkRect* src,
    19                                   const SkRect& dst, const SkPaint*) = 0;
    21     // Default impl calls onDraw
    22     virtual bool onReadPixels(SkBitmap*, const SkIRect& subset) const;
    24     virtual const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const {
    25         return NULL;
    26     }
    28     virtual GrTexture* onGetTexture() { return NULL; }
    30     // return a read-only copy of the pixels. We promise to not modify them,
    31     // but only inspect them (or encode them).
    32     virtual bool getROPixels(SkBitmap*) const { return false; }
    34 private:
    35     typedef SkImage INHERITED;
    36 };
    38 #endif

mercurial