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

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: Address style issues. Created 8 years, 10 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 } // namespace 45 } // namespace
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 skia::PlatformDevice::GetDefaultFlags(is_opaque))),
Jeff Timanus 2012/02/23 22:14:10 These clears would require a #if WIN/LINUX block t
55 canvas_(owned_canvas_.get()) { 55 canvas_(owned_canvas_.get()) {
56 } 56 }
57 57
58 CanvasSkia::CanvasSkia(const SkBitmap& bitmap, bool is_opaque) 58 CanvasSkia::CanvasSkia(const SkBitmap& bitmap, bool is_opaque)
59 : owned_canvas_(new skia::PlatformCanvas(bitmap.width(), bitmap.height(), 59 : owned_canvas_(new skia::PlatformCanvas(bitmap.width(), bitmap.height(),
60 is_opaque)), 60 skia::PlatformDevice::GetDefaultFlags(is_opaque))),
61 canvas_(owned_canvas_.get()) { 61 canvas_(owned_canvas_.get()) {
62 DrawBitmapInt(bitmap, 0, 0); 62 DrawBitmapInt(bitmap, 0, 0);
63 } 63 }
64 64
65 CanvasSkia::CanvasSkia() 65 CanvasSkia::CanvasSkia()
66 : owned_canvas_(new skia::PlatformCanvas()), 66 : owned_canvas_(new skia::PlatformCanvas()),
67 canvas_(owned_canvas_.get()) { 67 canvas_(owned_canvas_.get()) {
68 } 68 }
69 69
70 CanvasSkia::CanvasSkia(SkCanvas* canvas) 70 CanvasSkia::CanvasSkia(SkCanvas* canvas)
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 427
428 CanvasPaint* CanvasPaint::CreateCanvasPaint(gfx::NativeView view) { 428 CanvasPaint* CanvasPaint::CreateCanvasPaint(gfx::NativeView view) {
429 #if defined(OS_WIN) && !defined(USE_AURA) 429 #if defined(OS_WIN) && !defined(USE_AURA)
430 return new CanvasPaintWin(view); 430 return new CanvasPaintWin(view);
431 #else 431 #else
432 return NULL; 432 return NULL;
433 #endif 433 #endif
434 } 434 }
435 435
436 } // namespace gfx 436 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698