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 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 #include "platform/graphics/ImageBufferSurface.h" | 31 #include "platform/graphics/ImageBufferSurface.h" |
32 | 32 |
33 #include "platform/graphics/GraphicsContext.h" | 33 #include "platform/graphics/GraphicsContext.h" |
34 #include "platform/graphics/ImageBuffer.h" | 34 #include "platform/graphics/ImageBuffer.h" |
35 #include "platform/graphics/StaticBitmapImage.h" | 35 #include "platform/graphics/StaticBitmapImage.h" |
36 #include "third_party/skia/include/core/SkColorSpace.h" | 36 #include "third_party/skia/include/core/SkColorSpace.h" |
37 #include "third_party/skia/include/core/SkImage.h" | 37 #include "third_party/skia/include/core/SkImage.h" |
38 | 38 |
39 | |
40 namespace blink { | 39 namespace blink { |
41 | 40 |
42 ImageBufferSurface::ImageBufferSurface(const IntSize& size, | 41 ImageBufferSurface::ImageBufferSurface(const IntSize& size, |
43 OpacityMode opacity_mode, | 42 OpacityMode opacity_mode, |
44 const CanvasColorParams& color_params) | 43 const CanvasColorParams& color_params) |
45 : opacity_mode_(opacity_mode), size_(size), color_params_(color_params) { | 44 : opacity_mode_(opacity_mode), size_(size), color_params_(color_params) { |
46 SetIsHidden(false); | 45 SetIsHidden(false); |
47 } | 46 } |
48 | 47 |
49 ImageBufferSurface::~ImageBufferSurface() {} | 48 ImageBufferSurface::~ImageBufferSurface() {} |
(...skipping 27 matching lines...) Expand all Loading... |
77 | 76 |
78 RefPtr<Image> image = StaticBitmapImage::Create(std::move(snapshot)); | 77 RefPtr<Image> image = StaticBitmapImage::Create(std::move(snapshot)); |
79 context.DrawImage(image.Get(), dest_rect, &src_rect, op); | 78 context.DrawImage(image.Get(), dest_rect, &src_rect, op); |
80 } | 79 } |
81 | 80 |
82 void ImageBufferSurface::Flush(FlushReason) { | 81 void ImageBufferSurface::Flush(FlushReason) { |
83 Canvas()->flush(); | 82 Canvas()->flush(); |
84 } | 83 } |
85 | 84 |
86 } // namespace blink | 85 } // namespace blink |
OLD | NEW |