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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 // Canvas, public: | 359 // Canvas, public: |
360 | 360 |
361 Canvas* Canvas::CreateCanvas() { | 361 Canvas* Canvas::CreateCanvas() { |
362 return new CanvasSkia; | 362 return new CanvasSkia; |
363 } | 363 } |
364 | 364 |
365 Canvas* Canvas::CreateCanvas(int width, int height, bool is_opaque) { | 365 Canvas* Canvas::CreateCanvas(int width, int height, bool is_opaque) { |
366 return new CanvasSkia(width, height, is_opaque); | 366 return new CanvasSkia(width, height, is_opaque); |
367 } | 367 } |
368 | 368 |
369 #if defined(OS_WIN) | 369 #if defined(OS_WIN) && !defined(USE_AURA) |
370 // TODO(beng): move to canvas_win.cc, etc. | 370 // TODO(beng): move to canvas_win.cc, etc. |
371 class CanvasPaintWin : public CanvasSkiaPaint, public CanvasPaint { | 371 class CanvasPaintWin : public CanvasSkiaPaint, public CanvasPaint { |
372 public: | 372 public: |
373 CanvasPaintWin(gfx::NativeView view) : CanvasSkiaPaint(view) {} | 373 CanvasPaintWin(gfx::NativeView view) : CanvasSkiaPaint(view) {} |
374 | 374 |
375 // Overridden from CanvasPaint2: | 375 // Overridden from CanvasPaint2: |
376 virtual bool IsValid() const { | 376 virtual bool IsValid() const { |
377 return isEmpty(); | 377 return isEmpty(); |
378 } | 378 } |
379 | 379 |
380 virtual gfx::Rect GetInvalidRect() const { | 380 virtual gfx::Rect GetInvalidRect() const { |
381 return gfx::Rect(paintStruct().rcPaint); | 381 return gfx::Rect(paintStruct().rcPaint); |
382 } | 382 } |
383 | 383 |
384 virtual Canvas* AsCanvas() { | 384 virtual Canvas* AsCanvas() { |
385 return this; | 385 return this; |
386 } | 386 } |
387 }; | 387 }; |
388 #endif | 388 #endif |
389 | 389 |
390 CanvasPaint* CanvasPaint::CreateCanvasPaint(gfx::NativeView view) { | 390 CanvasPaint* CanvasPaint::CreateCanvasPaint(gfx::NativeView view) { |
391 #if defined(OS_WIN) | 391 #if defined(OS_WIN) && !defined(USE_AURA) |
392 return new CanvasPaintWin(view); | 392 return new CanvasPaintWin(view); |
393 #else | 393 #else |
394 return NULL; | 394 return NULL; |
395 #endif | 395 #endif |
396 } | 396 } |
397 | 397 |
398 } // namespace gfx | 398 } // namespace gfx |
OLD | NEW |