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

Side by Side Diff: ppapi/proxy/ppb_image_data_proxy.cc

Issue 7019013: Removal of dependencies on PlatformDevice classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Syncing merge conflicts. Created 9 years, 7 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
« no previous file with comments | « content/renderer/webplugin_delegate_proxy.cc ('k') | printing/emf_win.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ppapi/proxy/ppb_image_data_proxy.h" 5 #include "ppapi/proxy/ppb_image_data_proxy.h"
6 6
7 #include <string.h> // For memcpy 7 #include <string.h> // For memcpy
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 void* ImageData::Map() { 92 void* ImageData::Map() {
93 if (!mapped_canvas_.get()) { 93 if (!mapped_canvas_.get()) {
94 mapped_canvas_.reset(transport_dib_->GetPlatformCanvas(desc_.size.width, 94 mapped_canvas_.reset(transport_dib_->GetPlatformCanvas(desc_.size.width,
95 desc_.size.height)); 95 desc_.size.height));
96 if (!mapped_canvas_.get()) 96 if (!mapped_canvas_.get())
97 return NULL; 97 return NULL;
98 } 98 }
99 const SkBitmap& bitmap = 99 const SkBitmap& bitmap =
100 mapped_canvas_->getTopPlatformDevice().accessBitmap(true); 100 skia::GetTopDevice(*mapped_canvas_)->accessBitmap(true);
101 101
102 bitmap.lockPixels(); 102 bitmap.lockPixels();
103 return bitmap.getAddr(0, 0); 103 return bitmap.getAddr(0, 0);
104 } 104 }
105 105
106 void ImageData::Unmap() { 106 void ImageData::Unmap() {
107 // TODO(brettw) have a way to unmap a TransportDIB. Currently this isn't 107 // TODO(brettw) have a way to unmap a TransportDIB. Currently this isn't
108 // possible since deleting the TransportDIB also frees all the handles. 108 // possible since deleting the TransportDIB also frees all the handles.
109 // We need to add a method to TransportDIB to release the handles. 109 // We need to add a method to TransportDIB to release the handles.
110 } 110 }
(...skipping 11 matching lines...) Expand all
122 return reinterpret_cast<ImageHandle>(i); 122 return reinterpret_cast<ImageHandle>(i);
123 #elif defined(OS_MACOSX) 123 #elif defined(OS_MACOSX)
124 return ImageHandle(i, false); 124 return ImageHandle(i, false);
125 #else 125 #else
126 return static_cast<ImageHandle>(i); 126 return static_cast<ImageHandle>(i);
127 #endif 127 #endif
128 } 128 }
129 129
130 } // namespace proxy 130 } // namespace proxy
131 } // namespace pp 131 } // namespace pp
OLDNEW
« no previous file with comments | « content/renderer/webplugin_delegate_proxy.cc ('k') | printing/emf_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698