| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/gfx/ozone/impl/file_surface_factory.h" | 5 #include "ui/gfx/ozone/impl/file_surface_factory.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 11 #include "base/threading/worker_pool.h" | 11 #include "base/threading/worker_pool.h" |
| 12 #include "third_party/skia/include/core/SkBitmapDevice.h" | 12 #include "third_party/skia/include/core/SkBitmapDevice.h" |
| 13 #include "third_party/skia/include/core/SkDevice.h" | 13 #include "third_party/skia/include/core/SkDevice.h" |
| 14 #include "ui/gfx/codec/png_codec.h" | 14 #include "ui/gfx/codec/png_codec.h" |
| 15 #include "ui/gfx/vsync_provider.h" |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 void WriteDataToFile(const base::FilePath& location, | 19 void WriteDataToFile(const base::FilePath& location, |
| 19 const SkBitmap& bitmap) { | 20 const SkBitmap& bitmap) { |
| 20 std::vector<unsigned char> png_data; | 21 std::vector<unsigned char> png_data; |
| 21 gfx::PNGCodec::FastEncodeBGRASkBitmap(bitmap, true, &png_data); | 22 gfx::PNGCodec::FastEncodeBGRASkBitmap(bitmap, true, &png_data); |
| 22 file_util::WriteFile(location, | 23 file_util::WriteFile(location, |
| 23 (char*)vector_as_array(&png_data), | 24 (char*)vector_as_array(&png_data), |
| 24 png_data.size()); | 25 png_data.size()); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 base::Bind(&WriteDataToFile, location_, bitmap), | 83 base::Bind(&WriteDataToFile, location_, bitmap), |
| 83 true); | 84 true); |
| 84 } | 85 } |
| 85 return true; | 86 return true; |
| 86 } | 87 } |
| 87 | 88 |
| 88 SkCanvas* FileSurfaceFactory::GetCanvasForWidget(AcceleratedWidget w) { | 89 SkCanvas* FileSurfaceFactory::GetCanvasForWidget(AcceleratedWidget w) { |
| 89 return canvas_.get(); | 90 return canvas_.get(); |
| 90 } | 91 } |
| 91 | 92 |
| 92 VSyncProvider* FileSurfaceFactory::GetVSyncProvider(AcceleratedWidget w) { | 93 scoped_ptr<VSyncProvider> FileSurfaceFactory::CreateVSyncProvider( |
| 93 return NULL; | 94 AcceleratedWidget w) { |
| 95 return scoped_ptr<VSyncProvider>(); |
| 94 } | 96 } |
| 95 | 97 |
| 96 } // namespace gfx | 98 } // namespace gfx |
| OLD | NEW |