Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef UI_GFX_CANVAS_H_ | 5 #ifndef UI_GFX_CANVAS_H_ |
| 6 #define UI_GFX_CANVAS_H_ | 6 #define UI_GFX_CANVAS_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 436 SkCanvas* sk_canvas() const { return canvas_; } | 436 SkCanvas* sk_canvas() const { return canvas_; } |
| 437 float image_scale() const { return image_scale_; } | 437 float image_scale() const { return image_scale_; } |
| 438 | 438 |
| 439 private: | 439 private: |
| 440 Canvas(SkCanvas* canvas, float image_scale); | 440 Canvas(SkCanvas* canvas, float image_scale); |
| 441 | 441 |
| 442 // Test whether the provided rectangle intersects the current clip rect. | 442 // Test whether the provided rectangle intersects the current clip rect. |
| 443 bool IntersectsClipRectInt(int x, int y, int w, int h); | 443 bool IntersectsClipRectInt(int x, int y, int w, int h); |
| 444 bool IntersectsClipRect(const Rect& rect); | 444 bool IntersectsClipRect(const Rect& rect); |
| 445 | 445 |
| 446 // Returns the image rep which best matches the canvas |image_scale_|. | |
| 447 // Returns a null image rep if |image| contains no image reps. | |
| 448 // Builds mip map for returned image rep if necessary. | |
|
f(malita)
2014/05/07 17:09:46
SkBitmap::buildMipMap() is essentially dead code (
| |
| 449 // | |
| 450 // An optional additional user defined scale can be provided. | |
| 451 const ImageSkiaRep& GetImageRepToPaint(const ImageSkia& image) const; | |
| 452 const ImageSkiaRep& GetImageRepToPaint( | |
| 453 const ImageSkia& image, | |
| 454 float image_scale, | |
| 455 float user_defined_scale_factor_x, | |
| 456 float user_defined_scale_factor_y) const; | |
| 457 | |
| 458 // Helper for the DrawImageInt functions declared above. The |pixel| | 446 // Helper for the DrawImageInt functions declared above. The |pixel| |
| 459 // parameter if true indicates that the bounds and the image are to | 447 // parameter if true indicates that the bounds and the image are to |
| 460 // be assumed to be in pixels, i.e. no scaling needs to be performed. | 448 // be assumed to be in pixels, i.e. no scaling needs to be performed. |
| 461 void DrawImageIntHelper(const ImageSkia& image, | 449 void DrawImageIntHelper(const ImageSkia& image, |
| 462 int src_x, | 450 int src_x, |
| 463 int src_y, | 451 int src_y, |
| 464 int src_w, | 452 int src_w, |
| 465 int src_h, | 453 int src_h, |
| 466 int dest_x, | 454 int dest_x, |
| 467 int dest_y, | 455 int dest_y, |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 479 | 467 |
| 480 skia::RefPtr<skia::PlatformCanvas> owned_canvas_; | 468 skia::RefPtr<skia::PlatformCanvas> owned_canvas_; |
| 481 SkCanvas* canvas_; | 469 SkCanvas* canvas_; |
| 482 | 470 |
| 483 DISALLOW_COPY_AND_ASSIGN(Canvas); | 471 DISALLOW_COPY_AND_ASSIGN(Canvas); |
| 484 }; | 472 }; |
| 485 | 473 |
| 486 } // namespace gfx | 474 } // namespace gfx |
| 487 | 475 |
| 488 #endif // UI_GFX_CANVAS_H_ | 476 #endif // UI_GFX_CANVAS_H_ |
| OLD | NEW |