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

Side by Side Diff: app/surface/transport_dib_mac.cc

Issue 6665029: Adds a TransportDIB::Id value that is explicitly invalid and use it when compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compiles on windows Created 9 years, 9 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 | Annotate | Revision Log
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 "app/surface/transport_dib.h" 5 #include "app/surface/transport_dib.h"
6 6
7 #include <unistd.h> 7 #include <unistd.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 9
10 #include "base/eintr_wrapper.h" 10 #include "base/eintr_wrapper.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 return NULL; 44 return NULL;
45 return dib.release(); 45 return dib.release();
46 } 46 }
47 47
48 // static 48 // static
49 TransportDIB* TransportDIB::CreateWithHandle(Handle handle) { 49 TransportDIB* TransportDIB::CreateWithHandle(Handle handle) {
50 return new TransportDIB(handle); 50 return new TransportDIB(handle);
51 } 51 }
52 52
53 // static 53 // static
54 TransportDIB::Id TransportDIB::InvalidId() {
55 return -1;
56 }
57
58 // static
54 bool TransportDIB::is_valid(Handle dib) { 59 bool TransportDIB::is_valid(Handle dib) {
55 return dib.fd >= 0; 60 return dib.fd >= 0;
56 } 61 }
57 62
58 skia::PlatformCanvas* TransportDIB::GetPlatformCanvas(int w, int h) { 63 skia::PlatformCanvas* TransportDIB::GetPlatformCanvas(int w, int h) {
59 if (!memory() && !Map()) 64 if (!memory() && !Map())
60 return NULL; 65 return NULL;
61 scoped_ptr<skia::PlatformCanvas> canvas(new skia::PlatformCanvas); 66 scoped_ptr<skia::PlatformCanvas> canvas(new skia::PlatformCanvas);
62 if (!canvas->initialize(w, h, true, reinterpret_cast<uint8_t*>(memory()))) 67 if (!canvas->initialize(w, h, true, reinterpret_cast<uint8_t*>(memory())))
63 return NULL; 68 return NULL;
(...skipping 20 matching lines...) Expand all
84 return shared_memory_.memory(); 89 return shared_memory_.memory();
85 } 90 }
86 91
87 TransportDIB::Id TransportDIB::id() const { 92 TransportDIB::Id TransportDIB::id() const {
88 return shared_memory_.id(); 93 return shared_memory_.id();
89 } 94 }
90 95
91 TransportDIB::Handle TransportDIB::handle() const { 96 TransportDIB::Handle TransportDIB::handle() const {
92 return shared_memory_.handle(); 97 return shared_memory_.handle();
93 } 98 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698