| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 canvas()->clear(SK_ColorBLACK); | 63 canvas()->clear(SK_ColorBLACK); |
| 64 } else { | 64 } else { |
| 65 canvas()->clear(SK_ColorTRANSPARENT); | 65 canvas()->clear(SK_ColorTRANSPARENT); |
| 66 } | 66 } |
| 67 didDraw(FloatRect(FloatPoint(0, 0), FloatSize(size()))); | 67 didDraw(FloatRect(FloatPoint(0, 0), FloatSize(size()))); |
| 68 } | 68 } |
| 69 } | 69 } |
| 70 | 70 |
| 71 void ImageBufferSurface::draw(GraphicsContext& context, const FloatRect& destRec
t, const FloatRect& srcRect, SkXfermode::Mode op) | 71 void ImageBufferSurface::draw(GraphicsContext& context, const FloatRect& destRec
t, const FloatRect& srcRect, SkXfermode::Mode op) |
| 72 { | 72 { |
| 73 RefPtr<SkImage> snapshot = newImageSnapshot(PreferNoAcceleration); | 73 RefPtr<SkImage> snapshot = newImageSnapshot(PreferNoAcceleration, SnapshotRe
asonPaint); |
| 74 if (!snapshot) | 74 if (!snapshot) |
| 75 return; | 75 return; |
| 76 | 76 |
| 77 RefPtr<Image> image = StaticBitmapImage::create(snapshot.release()); | 77 RefPtr<Image> image = StaticBitmapImage::create(snapshot.release()); |
| 78 context.drawImage(image.get(), destRect, srcRect, op); | 78 context.drawImage(image.get(), destRect, srcRect, op); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void ImageBufferSurface::flush() | 81 void ImageBufferSurface::flush(FlushReason) |
| 82 { | 82 { |
| 83 canvas()->flush(); | 83 canvas()->flush(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 bool ImageBufferSurface::writePixels(const SkImageInfo& origInfo, const void* pi
xels, size_t rowBytes, int x, int y) | 86 bool ImageBufferSurface::writePixels(const SkImageInfo& origInfo, const void* pi
xels, size_t rowBytes, int x, int y) |
| 87 { | 87 { |
| 88 return canvas()->writePixels(origInfo, pixels, rowBytes, x, y); | 88 return canvas()->writePixels(origInfo, pixels, rowBytes, x, y); |
| 89 } | 89 } |
| 90 | 90 |
| 91 } // namespace blink | 91 } // namespace blink |
| OLD | NEW |