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_direct2d.h" | 5 #include "ui/gfx/canvas_direct2d.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "ui/gfx/brush.h" | 8 #include "ui/gfx/brush.h" |
9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
10 | 10 |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 } | 301 } |
302 | 302 |
303 void CanvasDirect2D::DrawStringInt(const string16& text, | 303 void CanvasDirect2D::DrawStringInt(const string16& text, |
304 const gfx::Font& font, | 304 const gfx::Font& font, |
305 const SkColor& color, | 305 const SkColor& color, |
306 int x, int y, int w, int h, | 306 int x, int y, int w, int h, |
307 int flags) { | 307 int flags) { |
308 NOTIMPLEMENTED(); | 308 NOTIMPLEMENTED(); |
309 } | 309 } |
310 | 310 |
311 void CanvasDirect2D::DrawFocusRect(int x, int y, int width, int height) { | 311 void CanvasDirect2D::DrawFocusRect(const gfx::Rect& rect) { |
312 NOTIMPLEMENTED(); | 312 NOTIMPLEMENTED(); |
313 } | 313 } |
314 | 314 |
315 void CanvasDirect2D::TileImageInt(const SkBitmap& bitmap, | 315 void CanvasDirect2D::TileImageInt(const SkBitmap& bitmap, |
316 int x, int y, int w, int h) { | 316 int x, int y, int w, int h) { |
317 base::win::ScopedComPtr<ID2D1Brush> brush( | 317 base::win::ScopedComPtr<ID2D1Brush> brush( |
318 CreateD2D1BrushFromSkBitmap(rt_, bitmap, D2D1_EXTEND_MODE_WRAP, | 318 CreateD2D1BrushFromSkBitmap(rt_, bitmap, D2D1_EXTEND_MODE_WRAP, |
319 D2D1_EXTEND_MODE_WRAP)); | 319 D2D1_EXTEND_MODE_WRAP)); |
320 rt_->FillRectangle(RectToRectF(x, y, w, h), brush); | 320 rt_->FillRectangle(RectToRectF(x, y, w, h), brush); |
321 } | 321 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 // CanvasDirect2D, private: | 362 // CanvasDirect2D, private: |
363 | 363 |
364 void CanvasDirect2D::SaveInternal(ID2D1Layer* layer) { | 364 void CanvasDirect2D::SaveInternal(ID2D1Layer* layer) { |
365 if (!drawing_state_block_) | 365 if (!drawing_state_block_) |
366 GetD2D1Factory()->CreateDrawingStateBlock(drawing_state_block_.Receive()); | 366 GetD2D1Factory()->CreateDrawingStateBlock(drawing_state_block_.Receive()); |
367 rt_->SaveDrawingState(drawing_state_block_.get()); | 367 rt_->SaveDrawingState(drawing_state_block_.get()); |
368 state_.push(RenderState(layer)); | 368 state_.push(RenderState(layer)); |
369 } | 369 } |
370 | 370 |
371 } // namespace gfx | 371 } // namespace gfx |
OLD | NEW |