| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 skia::PlatformCanvas* PPB_ImageData_Impl::GetPlatformCanvas() { | 114 skia::PlatformCanvas* PPB_ImageData_Impl::GetPlatformCanvas() { |
| 115 return mapped_canvas_.get(); | 115 return mapped_canvas_.get(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 const SkBitmap* PPB_ImageData_Impl::GetMappedBitmap() const { | 118 const SkBitmap* PPB_ImageData_Impl::GetMappedBitmap() const { |
| 119 if (!mapped_canvas_.get()) | 119 if (!mapped_canvas_.get()) |
| 120 return NULL; | 120 return NULL; |
| 121 return &skia::GetTopDevice(*mapped_canvas_)->accessBitmap(false); | 121 return &skia::GetTopDevice(*mapped_canvas_)->accessBitmap(false); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void PPB_ImageData_Impl::Swap(PPB_ImageData_Impl* other) { | 124 void PPB_ImageData_Impl::Swap(scoped_refptr<PPB_ImageData_Impl> other) { |
| 125 swap(other->platform_image_, platform_image_); | 125 swap(other->platform_image_, platform_image_); |
| 126 swap(other->mapped_canvas_, mapped_canvas_); | 126 swap(other->mapped_canvas_, mapped_canvas_); |
| 127 std::swap(other->format_, format_); | 127 std::swap(other->format_, format_); |
| 128 std::swap(other->width_, width_); | 128 std::swap(other->width_, width_); |
| 129 std::swap(other->height_, height_); | 129 std::swap(other->height_, height_); |
| 130 } | 130 } |
| 131 | 131 |
| 132 } // namespace ppapi | 132 } // namespace ppapi |
| 133 } // namespace webkit | 133 } // namespace webkit |
| 134 | 134 |
| OLD | NEW |