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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 void ImageBufferSurface::draw(GraphicsContext* context, const FloatRect& destRec
t, const FloatRect& srcRect, SkXfermode::Mode op) | 74 void ImageBufferSurface::draw(GraphicsContext* context, const FloatRect& destRec
t, const FloatRect& srcRect, SkXfermode::Mode op) |
75 { | 75 { |
76 RefPtr<SkImage> snapshot = newImageSnapshot(PreferNoAcceleration); | 76 RefPtr<SkImage> snapshot = newImageSnapshot(PreferNoAcceleration); |
77 if (!snapshot) | 77 if (!snapshot) |
78 return; | 78 return; |
79 | 79 |
80 RefPtr<Image> image = StaticBitmapImage::create(snapshot.release()); | 80 RefPtr<Image> image = StaticBitmapImage::create(snapshot.release()); |
81 context->drawImage(image.get(), destRect, srcRect, op); | 81 context->drawImage(image.get(), destRect, srcRect, op); |
82 } | 82 } |
83 | 83 |
84 const SkBitmap& ImageBufferSurface::deprecatedBitmapForOverwrite() | |
85 { | |
86 ASSERT_NOT_REACHED(); // should only be called on non-accelerated surface ty
pes, which have overrides | |
87 return canvas()->getDevice()->accessBitmap(false); // Because we have to ret
urn something for the code to compile, and it can't be a local (by address). | |
88 } | |
89 | |
90 | |
91 void ImageBufferSurface::flush() | 84 void ImageBufferSurface::flush() |
92 { | 85 { |
93 canvas()->flush(); | 86 canvas()->flush(); |
94 } | 87 } |
95 | 88 |
96 bool ImageBufferSurface::writePixels(const SkImageInfo& origInfo, const void* pi
xels, size_t rowBytes, int x, int y) | 89 bool ImageBufferSurface::writePixels(const SkImageInfo& origInfo, const void* pi
xels, size_t rowBytes, int x, int y) |
97 { | 90 { |
98 return canvas()->writePixels(origInfo, pixels, rowBytes, x, y); | 91 return canvas()->writePixels(origInfo, pixels, rowBytes, x, y); |
99 } | 92 } |
100 | 93 |
101 } // namespace blink | 94 } // namespace blink |
OLD | NEW |