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

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

Issue 2618373002: Remove PPB_ImageData_API::GetPlatformCanvas() (Closed)
Patch Set: Created 3 years, 11 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 | « ppapi/proxy/ppb_image_data_proxy.h ('k') | ppapi/thunk/ppb_image_data_api.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 skia::GetWritablePixels(mapped_canvas_.get(), &pixmap); 397 skia::GetWritablePixels(mapped_canvas_.get(), &pixmap);
398 return pixmap.writable_addr(); 398 return pixmap.writable_addr();
399 } 399 }
400 400
401 void PlatformImageData::Unmap() { 401 void PlatformImageData::Unmap() {
402 // TODO(brettw) have a way to unmap a TransportDIB. Currently this isn't 402 // TODO(brettw) have a way to unmap a TransportDIB. Currently this isn't
403 // possible since deleting the TransportDIB also frees all the handles. 403 // possible since deleting the TransportDIB also frees all the handles.
404 // We need to add a method to TransportDIB to release the handles. 404 // We need to add a method to TransportDIB to release the handles.
405 } 405 }
406 406
407 SkCanvas* PlatformImageData::GetPlatformCanvas() {
408 return mapped_canvas_.get();
409 }
410
411 SkCanvas* PlatformImageData::GetCanvas() { 407 SkCanvas* PlatformImageData::GetCanvas() {
412 return mapped_canvas_.get(); 408 return mapped_canvas_.get();
413 } 409 }
414 410
415 // static 411 // static
416 ImageHandle PlatformImageData::NullHandle() { 412 ImageHandle PlatformImageData::NullHandle() {
417 return ImageHandle(); 413 return ImageHandle();
418 } 414 }
419 #endif // !defined(OS_NACL) 415 #endif // !defined(OS_NACL)
420 416
(...skipping 15 matching lines...) Expand all
436 if (map_count_++ == 0) 432 if (map_count_++ == 0)
437 shm_.Map(size_); 433 shm_.Map(size_);
438 return shm_.memory(); 434 return shm_.memory();
439 } 435 }
440 436
441 void SimpleImageData::Unmap() { 437 void SimpleImageData::Unmap() {
442 if (--map_count_ == 0) 438 if (--map_count_ == 0)
443 shm_.Unmap(); 439 shm_.Unmap();
444 } 440 }
445 441
446 SkCanvas* SimpleImageData::GetPlatformCanvas() {
447 return NULL; // No canvas available.
448 }
449
450 SkCanvas* SimpleImageData::GetCanvas() { 442 SkCanvas* SimpleImageData::GetCanvas() {
451 return NULL; // No canvas available. 443 return NULL; // No canvas available.
452 } 444 }
453 445
454 // PPB_ImageData_Proxy --------------------------------------------------------- 446 // PPB_ImageData_Proxy ---------------------------------------------------------
455 447
456 PPB_ImageData_Proxy::PPB_ImageData_Proxy(Dispatcher* dispatcher) 448 PPB_ImageData_Proxy::PPB_ImageData_Proxy(Dispatcher* dispatcher)
457 : InterfaceProxy(dispatcher) { 449 : InterfaceProxy(dispatcher) {
458 } 450 }
459 451
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 // still cached in our process, the proxy still holds a reference so we can 660 // still cached in our process, the proxy still holds a reference so we can
669 // remove the one the renderer just sent is. If the proxy no longer holds a 661 // remove the one the renderer just sent is. If the proxy no longer holds a
670 // reference, we released everything and we should also release the one the 662 // reference, we released everything and we should also release the one the
671 // renderer just sent us. 663 // renderer just sent us.
672 dispatcher()->Send(new PpapiHostMsg_PPBCore_ReleaseResource( 664 dispatcher()->Send(new PpapiHostMsg_PPBCore_ReleaseResource(
673 API_ID_PPB_CORE, old_image_data)); 665 API_ID_PPB_CORE, old_image_data));
674 } 666 }
675 667
676 } // namespace proxy 668 } // namespace proxy
677 } // namespace ppapi 669 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_image_data_proxy.h ('k') | ppapi/thunk/ppb_image_data_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698