OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <limits> | 5 #include <limits> |
6 #include <windows.h> | 6 #include <windows.h> |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
10 #include "chrome/common/transport_dib.h" | 10 #include "chrome/common/transport_dib.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 // There doesn't seem to be any way to find the size of the shared memory | 53 // There doesn't seem to be any way to find the size of the shared memory |
54 // region! GetFileSize indicates that the handle is invalid. Thus, we | 54 // region! GetFileSize indicates that the handle is invalid. Thus, we |
55 // conservatively set the size to the maximum and hope that the renderer | 55 // conservatively set the size to the maximum and hope that the renderer |
56 // isn't about to ask us to read off the end of the array. | 56 // isn't about to ask us to read off the end of the array. |
57 dib->size_ = std::numeric_limits<size_t>::max(); | 57 dib->size_ = std::numeric_limits<size_t>::max(); |
58 | 58 |
59 return dib; | 59 return dib; |
60 } | 60 } |
61 | 61 |
| 62 skia::PlatformCanvas* TransportDIB::GetPlatformCanvas(int w, int h) { |
| 63 return new skia::PlatformCanvas(w, h, true, handle()); |
| 64 } |
| 65 |
62 void* TransportDIB::memory() const { | 66 void* TransportDIB::memory() const { |
63 return shared_memory_.memory(); | 67 return shared_memory_.memory(); |
64 } | 68 } |
65 | 69 |
66 TransportDIB::Handle TransportDIB::handle() const { | 70 TransportDIB::Handle TransportDIB::handle() const { |
67 return shared_memory_.handle(); | 71 return shared_memory_.handle(); |
68 } | 72 } |
69 | 73 |
70 TransportDIB::Id TransportDIB::id() const { | 74 TransportDIB::Id TransportDIB::id() const { |
71 return Id(shared_memory_.handle(), sequence_num_); | 75 return Id(shared_memory_.handle(), sequence_num_); |
72 } | 76 } |
OLD | NEW |