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

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

Issue 8422009: ui/gfx: Convert CreateCanvas to use gfx::Size. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/canvas.h ('k') | ui/gfx/compositor/layer.cc » ('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 "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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 SkIntToScalar(y + h)); 378 SkIntToScalar(y + h));
379 } 379 }
380 380
381 //////////////////////////////////////////////////////////////////////////////// 381 ////////////////////////////////////////////////////////////////////////////////
382 // Canvas, public: 382 // Canvas, public:
383 383
384 Canvas* Canvas::CreateCanvas() { 384 Canvas* Canvas::CreateCanvas() {
385 return new CanvasSkia; 385 return new CanvasSkia;
386 } 386 }
387 387
388 Canvas* Canvas::CreateCanvas(int width, int height, bool is_opaque) { 388 Canvas* Canvas::CreateCanvas(const gfx::Size& size, bool is_opaque) {
389 return new CanvasSkia(width, height, is_opaque); 389 return new CanvasSkia(size.width(), size.height(), is_opaque);
390 } 390 }
391 391
392 #if defined(OS_WIN) && !defined(USE_AURA) 392 #if defined(OS_WIN) && !defined(USE_AURA)
393 // TODO(beng): move to canvas_win.cc, etc. 393 // TODO(beng): move to canvas_win.cc, etc.
394 class CanvasPaintWin : public CanvasSkiaPaint, public CanvasPaint { 394 class CanvasPaintWin : public CanvasSkiaPaint, public CanvasPaint {
395 public: 395 public:
396 CanvasPaintWin(gfx::NativeView view) : CanvasSkiaPaint(view) {} 396 CanvasPaintWin(gfx::NativeView view) : CanvasSkiaPaint(view) {}
397 397
398 // Overridden from CanvasPaint2: 398 // Overridden from CanvasPaint2:
399 virtual bool IsValid() const { 399 virtual bool IsValid() const {
(...skipping 12 matching lines...) Expand all
412 412
413 CanvasPaint* CanvasPaint::CreateCanvasPaint(gfx::NativeView view) { 413 CanvasPaint* CanvasPaint::CreateCanvasPaint(gfx::NativeView view) {
414 #if defined(OS_WIN) && !defined(USE_AURA) 414 #if defined(OS_WIN) && !defined(USE_AURA)
415 return new CanvasPaintWin(view); 415 return new CanvasPaintWin(view);
416 #else 416 #else
417 return NULL; 417 return NULL;
418 #endif 418 #endif
419 } 419 }
420 420
421 } // namespace gfx 421 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/canvas.h ('k') | ui/gfx/compositor/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698