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

Side by Side Diff: ui/gfx/canvas_skia.cc

Issue 9416017: Optionally clear PlatformCanvas instances. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Use sites now clear if necessary. Created 8 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) 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 "ui/gfx/canvas_skia.h" 5 #include "ui/gfx/canvas_skia.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 namespace gfx { 47 namespace gfx {
48 48
49 //////////////////////////////////////////////////////////////////////////////// 49 ////////////////////////////////////////////////////////////////////////////////
50 // CanvasSkia, public: 50 // CanvasSkia, public:
51 51
52 CanvasSkia::CanvasSkia(const gfx::Size& size, bool is_opaque) 52 CanvasSkia::CanvasSkia(const gfx::Size& size, bool is_opaque)
53 : owned_canvas_(new skia::PlatformCanvas(size.width(), size.height(), 53 : owned_canvas_(new skia::PlatformCanvas(size.width(), size.height(),
54 is_opaque)), 54 is_opaque)),
55 canvas_(owned_canvas_.get()) { 55 canvas_(owned_canvas_.get()) {
56 #if defined(OS_WIN) || defined(OS_MACOSX)
57 owned_canvas_->drawARGB(0, 0, 0, 0);
58 #endif
56 } 59 }
57 60
58 CanvasSkia::CanvasSkia(const SkBitmap& bitmap, bool is_opaque) 61 CanvasSkia::CanvasSkia(const SkBitmap& bitmap, bool is_opaque)
59 : owned_canvas_(new skia::PlatformCanvas(bitmap.width(), bitmap.height(), 62 : owned_canvas_(new skia::PlatformCanvas(bitmap.width(), bitmap.height(),
60 is_opaque)), 63 is_opaque)),
61 canvas_(owned_canvas_.get()) { 64 canvas_(owned_canvas_.get()) {
62 DrawBitmapInt(bitmap, 0, 0); 65 DrawBitmapInt(bitmap, 0, 0);
63 } 66 }
64 67
65 CanvasSkia::CanvasSkia() 68 CanvasSkia::CanvasSkia()
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 430
428 CanvasPaint* CanvasPaint::CreateCanvasPaint(gfx::NativeView view) { 431 CanvasPaint* CanvasPaint::CreateCanvasPaint(gfx::NativeView view) {
429 #if defined(OS_WIN) && !defined(USE_AURA) 432 #if defined(OS_WIN) && !defined(USE_AURA)
430 return new CanvasPaintWin(view); 433 return new CanvasPaintWin(view);
431 #else 434 #else
432 return NULL; 435 return NULL;
433 #endif 436 #endif
434 } 437 }
435 438
436 } // namespace gfx 439 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698