| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkGatherPixelRefsAndRects_DEFINED | 8 #ifndef SkGatherPixelRefsAndRects_DEFINED |
| 9 #define SkGatherPixelRefsAndRects_DEFINED | 9 #define SkGatherPixelRefsAndRects_DEFINED |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 | 33 |
| 34 virtual ~SkGatherPixelRefsAndRectsDevice() { | 34 virtual ~SkGatherPixelRefsAndRectsDevice() { |
| 35 SkSafeUnref(fPRCont); | 35 SkSafeUnref(fPRCont); |
| 36 } | 36 } |
| 37 | 37 |
| 38 virtual SkImageInfo imageInfo() const SK_OVERRIDE { | 38 virtual SkImageInfo imageInfo() const SK_OVERRIDE { |
| 39 return fEmptyBitmap.info(); | 39 return fEmptyBitmap.info(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE { return NULL; } | |
| 43 | |
| 44 protected: | 42 protected: |
| 45 virtual bool filterTextFlags(const SkPaint& paint, TextFlags*) SK_OVERRIDE { | |
| 46 return false; | |
| 47 } | |
| 48 virtual void clear(SkColor color) SK_OVERRIDE { | 43 virtual void clear(SkColor color) SK_OVERRIDE { |
| 49 NothingToDo(); | 44 NothingToDo(); |
| 50 } | 45 } |
| 51 virtual void drawPaint(const SkDraw& draw, const SkPaint& paint) SK_OVERRIDE
{ | 46 virtual void drawPaint(const SkDraw& draw, const SkPaint& paint) SK_OVERRIDE
{ |
| 52 SkBitmap bm; | 47 SkBitmap bm; |
| 53 | 48 |
| 54 if (GetBitmapFromPaint(paint, &bm)) { | 49 if (GetBitmapFromPaint(paint, &bm)) { |
| 55 SkRect clipRect = SkRect::Make(draw.fRC->getBounds()); | 50 SkRect clipRect = SkRect::Make(draw.fRC->getBounds()); |
| 56 fPRCont->add(bm.pixelRef(), clipRect); | 51 fPRCont->add(bm.pixelRef(), clipRect); |
| 57 } | 52 } |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 NotSupported(); | 307 NotSupported(); |
| 313 } | 308 } |
| 314 | 309 |
| 315 virtual SkBaseDevice* onCreateDevice(const SkImageInfo& info, Usage usage) S
K_OVERRIDE { | 310 virtual SkBaseDevice* onCreateDevice(const SkImageInfo& info, Usage usage) S
K_OVERRIDE { |
| 316 // we expect to only get called via savelayer, in which case it is fine. | 311 // we expect to only get called via savelayer, in which case it is fine. |
| 317 SkASSERT(kSaveLayer_Usage == usage); | 312 SkASSERT(kSaveLayer_Usage == usage); |
| 318 return SkNEW_ARGS(SkGatherPixelRefsAndRectsDevice, | 313 return SkNEW_ARGS(SkGatherPixelRefsAndRectsDevice, |
| 319 (info.width(), info.height(), fPRCont)); | 314 (info.width(), info.height(), fPRCont)); |
| 320 } | 315 } |
| 321 | 316 |
| 322 virtual void flush() SK_OVERRIDE {} | |
| 323 | |
| 324 static void NotSupported() { | 317 static void NotSupported() { |
| 325 SkDEBUGFAIL("this method should never be called"); | 318 SkDEBUGFAIL("this method should never be called"); |
| 326 } | 319 } |
| 327 | 320 |
| 328 static void NothingToDo() {} | 321 static void NothingToDo() {} |
| 329 | 322 |
| 330 typedef SkBaseDevice INHERITED; | 323 typedef SkBaseDevice INHERITED; |
| 331 }; | 324 }; |
| 332 | 325 |
| 333 #endif // SkGatherPixelRefsAndRects_DEFINED | 326 #endif // SkGatherPixelRefsAndRects_DEFINED |
| OLD | NEW |