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

Unified Diff: app/surface/transport_dib.h

Issue 4569002: Fix ThumbnailGenerator on Windows. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Just fix thumbnail generator for now Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | app/surface/transport_dib_linux.cc » ('j') | app/surface/transport_dib_win.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/surface/transport_dib.h
diff --git a/app/surface/transport_dib.h b/app/surface/transport_dib.h
index 6606c2b675da22a87681d513ba76e8130ba5e9f2..d82c346208fd25ae9c425aef04a19aa6090d0a09 100644
--- a/app/surface/transport_dib.h
+++ b/app/surface/transport_dib.h
@@ -124,6 +124,10 @@ class TransportDIB {
// Returns NULL on failure.
static TransportDIB* Map(Handle transport_dib);
+ // Create a new |TransportDIB| with a handle to the shared memory. This
+ // always returns a valid pointer. The DIB is not mapped.
+ static TransportDIB* CreateWithHandle(Handle handle);
+
// Returns true if the handle is valid.
static bool is_valid(Handle dib);
@@ -131,11 +135,19 @@ class TransportDIB {
// pointer will be owned by the caller. The bitmap will be of the given size,
// which should fit inside this memory.
//
+ // On POSIX, this |TransportDIB| will be mapped if not already. On Windows,
+ // this |TransportDIB| will NOT be mapped and should not be mapped prior,
+ // because PlatformCanvas will map the file internally.
+ //
// Will return NULL on allocation failure. This could be because the image
// is too large to map into the current process' address space.
skia::PlatformCanvas* GetPlatformCanvas(int w, int h);
- // Return a pointer to the shared memory
+ // Map the DIB into the current process if it is not already. This is used to
+ // map a DIB that has already been created. Returns true if the DIB is mapped.
+ bool Map();
+
+ // Return a pointer to the shared memory.
void* memory() const;
// Return the maximum size of the shared memory. This is not the amount of
« no previous file with comments | « no previous file | app/surface/transport_dib_linux.cc » ('j') | app/surface/transport_dib_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698