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

Side by Side Diff: runtime/embedders/openglui/common/canvas_context.h

Issue 12212074: Support for non-DOM canvases/contexts (backed by bitaps). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 months 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef EMBEDDERS_OPENGLUI_COMMON_CANVAS_CONTEXT_H_ 5 #ifndef EMBEDDERS_OPENGLUI_COMMON_CANVAS_CONTEXT_H_
6 #define EMBEDDERS_OPENGLUI_COMMON_CANVAS_CONTEXT_H_ 6 #define EMBEDDERS_OPENGLUI_COMMON_CANVAS_CONTEXT_H_
7 7
8 #include "embedders/openglui/common/canvas_state.h" 8 #include "embedders/openglui/common/canvas_state.h"
9 #include "embedders/openglui/common/graphics_handler.h" 9 #include "embedders/openglui/common/graphics_handler.h"
10 #include "embedders/openglui/common/log.h" 10 #include "embedders/openglui/common/log.h"
(...skipping 25 matching lines...) Expand all
36 36
37 static inline float Radians2Degrees(float angle) { 37 static inline float Radians2Degrees(float angle) {
38 return 180.0 * angle / M_PI; 38 return 180.0 * angle / M_PI;
39 } 39 }
40 40
41 inline void NotImplemented(const char* method) { 41 inline void NotImplemented(const char* method) {
42 LOGE("Method CanvasContext::%s is not yet implemented", method); 42 LOGE("Method CanvasContext::%s is not yet implemented", method);
43 } 43 }
44 44
45 public: 45 public:
46 CanvasContext(int16_t width, int16_t height); 46 CanvasContext(int handle, int16_t width, int16_t height);
47 virtual ~CanvasContext(); 47 virtual ~CanvasContext();
48 48
49 inline void setGlobalAlpha(float alpha) { 49 inline void setGlobalAlpha(float alpha) {
50 state_->setGlobalAlpha(alpha); 50 state_->setGlobalAlpha(alpha);
51 } 51 }
52 52
53 inline void setFillColor(const char* color) { 53 inline void setFillColor(const char* color) {
54 state_->setFillColor(color); 54 state_->setFillColor(color);
55 } 55 }
56 56
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 } 285 }
286 286
287 inline void ResetClip() { 287 inline void ResetClip() {
288 // TODO(gram): Check this. Is it affected by the transform? 288 // TODO(gram): Check this. Is it affected by the transform?
289 canvas_->clipRect(SkRect::MakeLTRB(0, 0, width_, height_), 289 canvas_->clipRect(SkRect::MakeLTRB(0, 0, width_, height_),
290 SkRegion::kReplace_Op); 290 SkRegion::kReplace_Op);
291 } 291 }
292 292
293 virtual void Flush() { 293 virtual void Flush() {
294 canvas_->flush(); 294 canvas_->flush();
295 graphics->Flush();
296 } 295 }
296 };
297 297
298 void Create(); 298 CanvasContext* Context2D(int handle);
299 };
300 299
301 #endif // EMBEDDERS_OPENGLUI_COMMON_CANVAS_CONTEXT_H_ 300 #endif // EMBEDDERS_OPENGLUI_COMMON_CANVAS_CONTEXT_H_
302 301
OLDNEW
« no previous file with comments | « no previous file | runtime/embedders/openglui/common/canvas_context.cc » ('j') | runtime/embedders/openglui/common/gl.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698