OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |