Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: chrome/common/transport_dib_win.cc

Issue 126101: Adds kind-of-live thumbnail generation for a potential tab switcher. (Closed)
Patch Set: For Checking hopefully Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/common/transport_dib_mac.cc ('k') | chrome/renderer/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "skia/ext/platform_canvas.h"
11 12
12 TransportDIB::TransportDIB() { 13 TransportDIB::TransportDIB() {
13 } 14 }
14 15
15 TransportDIB::~TransportDIB() { 16 TransportDIB::~TransportDIB() {
16 } 17 }
17 18
18 TransportDIB::TransportDIB(HANDLE handle) 19 TransportDIB::TransportDIB(HANDLE handle)
19 : shared_memory_(handle, false /* read write */) { 20 : shared_memory_(handle, false /* read write */) {
20 } 21 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 53
53 // There doesn't seem to be any way to find the size of the shared memory 54 // 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 55 // region! GetFileSize indicates that the handle is invalid. Thus, we
55 // conservatively set the size to the maximum and hope that the renderer 56 // 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. 57 // isn't about to ask us to read off the end of the array.
57 dib->size_ = std::numeric_limits<size_t>::max(); 58 dib->size_ = std::numeric_limits<size_t>::max();
58 59
59 return dib; 60 return dib;
60 } 61 }
61 62
63 skia::PlatformCanvas* TransportDIB::GetPlatformCanvas(int w, int h) {
64 return new skia::PlatformCanvas(w, h, true, handle());
65 }
66
62 void* TransportDIB::memory() const { 67 void* TransportDIB::memory() const {
63 return shared_memory_.memory(); 68 return shared_memory_.memory();
64 } 69 }
65 70
66 TransportDIB::Handle TransportDIB::handle() const { 71 TransportDIB::Handle TransportDIB::handle() const {
67 return shared_memory_.handle(); 72 return shared_memory_.handle();
68 } 73 }
69 74
70 TransportDIB::Id TransportDIB::id() const { 75 TransportDIB::Id TransportDIB::id() const {
71 return Id(shared_memory_.handle(), sequence_num_); 76 return Id(shared_memory_.handle(), sequence_num_);
72 } 77 }
OLDNEW
« no previous file with comments | « chrome/common/transport_dib_mac.cc ('k') | chrome/renderer/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698